This topic is locked
[SOLVED]

 Lookup Wizard WHERE condition by using a master table field

3/28/2020 12:51:26 PM
PHPRunner General questions
J
jacktonghk authorDevClub member

I have an order master file and an order detail table. I also have an item price catalog table which stores item prices for different customer groups.
In the order master table page, the user will enter a customer group and then when the user enters an item in the order detail page, I would like the autofill the item price based on the customer group entered in the master page. I used lookup wizard for the item, set up auto fill but I don't know how to specify the WHERE clause to control drop down list by the customer group.
How should I specify the WHERE clause? Thanks.

Admin 3/28/2020

Please take a look at this:

https://xlinesoft.com/phprunner/docs/sql_variables.htm
You can use SQL variables to reference a field from the Master table.

J
jackwood 3/29/2020



Please take a look at this:

https://xlinesoft.com/phprunner/docs/sql_variables.htm
You can use SQL variables to reference a field from the Master table.


Hi Sergey,
Where I have to replace Session Code for save the session Customergroup table and Load into dropdown Item from details transaction ?
I've try to replace in before records add this , but doen't work.
$_SESSION["Customergroup_masterkey1"] ;

$_SESSION["_Customergroup_CustgroupID"] ;

Admin 3/29/2020

@Jaja,
instead of hijacking this thread that asks a different question I recommend to start your own and explain your issue there.

J
jacktonghk authorDevClub member 3/29/2020



Please take a look at this:

https://xlinesoft.com/phprunner/docs/sql_variables.htm
You can use SQL variables to reference a field from the Master table.


It works. Thank you. I have another question, how can I assign a master table field value to a detail table field in the before record updated/added event? The field is not a linked field. Thanks.

Admin 3/29/2020

You can. PHPRunner provides getMasterRecord API call that will help you access data of the master record.

https://xlinesoft.com/phprunner/docs/getmasterrecord.htm

J
jacktonghk authorDevClub member 3/30/2020



You can. PHPRunner provides getMasterRecord API call that will help you access data of the master record.

https://xlinesoft.com/phprunner/docs/getmasterrecord.htm


Got it!! Thank you!!