This topic is locked
[SOLVED]

 Master-Detail set up where condition for lookup wizard in detail table

10/12/2019 12:04:22 AM
PHPRunner General questions
J
jacktonghk authorDevClub member

I have a purchase order master-detail relationship. In the master table a have field 'supplier' and in the detail table I a have a field 'item'. I also has a supplier/item relationship table which stores which 'supplier' sells which 'item'. Now I would like to define my 'item' field in the detail table as a lookup wizard field. How should I set the where condition in the lookup wizard so that it only lists the specific supplier's selling items? Thanks.

J
jacktonghk authorDevClub member 10/12/2019

Problem solved. I use the SQL variables :master.supplier whereas supplier is a field in my master table that I would like to use as the filter.
My syntax supplier = ':master.supplier'
Below is from the Help Manual section 'SQL variables in SQL and Lookup wizards'
A full list of SQL variables:

:field - current field value on Add, Edit or Register page


:master.field - any field from master record


:session.key - any session variable


:user.field - any field from login table


:old.field - old field value (before any changes were applied)


:new.field - new field value.
J
jackwood 10/14/2019



Problem solved. I use the SQL variables :master.supplier whereas supplier is a field in my master table that I would like to use as the filter.
My syntax supplier = ':master.supplier'
Below is from the Help Manual section 'SQL variables in SQL and Lookup wizards'
A full list of SQL variables:
:field - current field value on Add, Edit or Register page
:master.field - any field from master record
:session.key - any session variable
:user.field - any field from login table
:old.field - old field value (before any changes were applied)
:new.field - new field value.



-----------------------------------------------------------------------------
Hi Jack Tong,
Could you share more details Step by Step Info regarding this Case for other members maybe have same approach case?