This topic is locked
[SOLVED]

 Lookup filtered

5/20/2020 2:52:02 AM
PHPRunner General questions
rdf author

Hi PHPR community,
I want to know how can you filter a lookup on a detail table based on a column value on a Master table?
Example:

MAINFORM - Master table

id

system_id
FORMDETAIL - Detail table

id

mainform_id

category_id (lookup should only show depending on value of system_id on MAINFORM master table)
SYSTEM

id

name
CATEGORY

id

name

system_id
Is it only possible via event custom code?

N
Nir Frumer 5/20/2020



Hi PHPR community,
I want to know how can you filter a lookup on a detail table based on a column value on a Master table?
Example:

MAINFORM - Master table

id

system_id
FORMDETAIL - Detail table

id

mainform_id

category_id (lookup should only show depending on value of system_id on MAINFORM master table)
SYSTEM

id

name
CATEGORY

id

name

system_id
Is it only possible via event custom code?


hi

on the add/edit pages

before display event

$data=$pageObject->getMasterRecord();

$_SESSION['varId']=$data['id'];
on your lookup WHERE put

id=$_SESSION['varId']
hope it helps

rdf author 5/20/2020



hi

on the add/edit pages

before display event

$data=$pageObject->getMasterRecord();

$_SESSION['varId']=$data['id'];
on your lookup WHERE put

id=$_SESSION['varId']
hope it helps


Thank you much for providing a solution. I will try it as well.
Searching and reading along the forums I also found about this thread which also is a solution.

[SOLVED] Lookup Wizard WHERE condition by using a master table field