This topic is locked

Lookup wizard with 2 keys

12/14/2005 11:06:38 PM
PHPRunner General questions
T
TheSaint author

Hi we bought this product recently - works great and solved a lot of problems - but we have 1 issue.
As near as I can tell the lookup wizard won't work with 2 keys, i.e., in the WHERE clause we want to qualify the search by some other value in the row we are adding or displaying. Is this possible or planned? The doc seems to hint as a session variable, but we couldn't find any, help!
This product is really great overall and my only other issue is that the date search seems broken, but does work on advanced search.

Sergey Kornilov admin 12/15/2005

Hi,
PHPRunner doesn't support multiple keys for Lookup wizard. To tell the truth I have no idea on how this can be useful.

Maybe dependent dropdowns feature will help you.

You can describe your project and I'll try to help you to setup it.
Date search should work fine.

Just make sure that you use DATE or DATETIME column type for your date field and that you enter dates into "Search for" box in your local format. I.e. 12/15/2005, not 2005-12-15

T
TheSaint author 12/15/2005

Hi here is an example:
CREATE TABLE `ARcustomerTaxes` (

`Id` int(11) NOT NULL auto_increment,

`BusinessUnit` varchar(5) default NULL,

`CustomerNumber` int(11) unsigned default NULL,

`taxCode` varchar(16) default NULL,

PRIMARY KEY (`Id`)

) TYPE=MyISAM;
This the table we want to use. We want to have phprunner use the table above, but to get "customer name" from a lookup table:
CREATE TABLE `ARcustomer` (

`Id` int(11) NOT NULL auto_increment,

`BusinessUnit` varchar(5) NOT NULL default '',

`CustomerNumber` int(9) unsigned NOT NULL default '0',

`name` varchar(64) default NULL,

...

PRIMARY KEY (`Id`),

UNIQUE KEY `BusinessUnit` (`BusinessUnit`,`CustomerNumber`)

) TYPE=MyISAM;
Unfortunately as you can see to get "name" we need BusinessUnit AND CustomerNumber. We can't easily add "Id" which would solve the problem.
Thanks - Steve

Hi,

PHPRunner doesn't support multiple keys for Lookup wizard. To tell the truth I have no idea on how this can be useful.

Maybe dependent dropdowns feature will help you.

You can describe your project and I'll try to help you to setup it.
Date search should work fine.

Just make sure that you use DATE or DATETIME column type for your date field and that you enter dates into "Search for" box in your local format. I.e. 12/15/2005, not 2005-12-15

Sergey Kornilov admin 12/16/2005

Steve,
you can use dependent dropdowns for this.
Choose ARcustomerTaxes table in PHPRunner and proceed to Formattingtab.

Select Edit type Lookup wizardfor BusinessUnit field.

Choose ARcustomeras a lookup table, BusinessUnit as Linkand Displayfield.

Check off Unique valuescheckbox.
Then select Edit type Lookup wizardfor CustomerNumber field.

Choose ARcustomeras a lookup table, CustomerNumber as Linkand Displayfield.

Then check off "This dropdown is dependent on..."and select BusinessUnit as Category controland Category field.

T
TheSaint author 12/19/2005

Thanks, worked perfectly. I was never able to get the dependent drop downs working before, looks fine now.

Steve,

you can use dependent dropdowns for this.
Choose ARcustomerTaxes table in PHPRunner and proceed to Formattingtab.

Select Edit type Lookup wizardfor BusinessUnit field.

Choose ARcustomeras a lookup table, BusinessUnit as Linkand Displayfield.

Check off Unique valuescheckbox.
Then select Edit type Lookup wizardfor CustomerNumber field.

Choose ARcustomeras a lookup table, CustomerNumber as Linkand Displayfield.

Then check off "This dropdown is dependent on..."and select BusinessUnit as Category controland Category field.