Search data from another table from within record

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
david22585
User
Posts: 1

Search data from another table from within record

Post by david22585 »

Hello all,

I'm working on a project for our homeowners association, where we will have a table for each unit that has the owners name, address, contact into, etc. On other tables, we have one for work orders submitted, another for messages sent to us, another for landscape requests, etc. Since the work orders cannot be 100% synced with an ID, what I would like to do is when you view say owner Smith and their information, there is a link that will search the work orders or any other table with their address number 12345?

For example, I'm viewing unit number 10, with an address of 12345 Park Ave, owner John Smith. On there, I will have a few links, the first will search table workorders for any data that matches 12345. There will be another link that searches for data from contact the board with a value that matches 12345.

Thanks
-David


mobhar
User
Posts: 11702

Post by mobhar »

It actually depends on your tables schema. For more discussion, then please post your tables schema.


sangnandar
User
Posts: 980

Post by sangnandar »

These things below took place on client-side.

  1. You already have values of the record. Access these values with jQuery .val() method.
  2. Put a link/button that will do:

onclick:

  • Do ajax call to server-side with the value (step 1).
  • Do some query with ajax handler on server-side Page_Load(). Fetch back the result to client-side.
  • Display the result, again, with jQuery .val() method.

BUT...
I strongly suggest you to check your database design. Looks like your case can be solved with simple master-detail relation.

Useful reference and examples of ajax call can be found in "Lookup Table" section under Project Setup in the help file.


Post Reply