filtering on master record

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

filtering on master record

Post by cdeniro »

I am trying to use a field in the master record to filter results of a lookup field on a detail table

Master table:
field1
field2
field3

Detail Table:
field4
field5

Data table:
field4
field3

How can i filter records in the lookup (data table) for field4 using field3 from the master table?


danielc
User
Posts: 1601

Post by danielc »

If you meant during Master/Detail-Add/Edit, you should do that by JavaScript.

The approach can be like:

  • make sure the selection list in the detail table does not use Ajax (so you have all options in the selection list for you to filter)
  • add onchange event to the field in master table and save the options of the selection list in the detail table to a global variable (e.g. using Startup Script, read Server Events and Client Script in the help file), then clear the options
  • when fired, the onchange event loop through the options from the global variable and add the valid ones to the selection list in the detail table

Post Reply