lookup widget help
Posted: Tue Jun 08, 2010 4:54 pm
Hello,
I'm trying to use a lookup widget on the following table and I'm having trouble finding much documentation on lookup widgets.
The fields.ini file:
I was hoping I could use the view entity_consolidated_vw below to customize the lookup widget:
`entity` is the parent table to the `business_org` and `individual` tables. I want the lookup to place the Entity_ID into the Parent_Entity_ID field in the `entity` table and search based on the union of `business_org`.`DBA` and concat(`individual`.`First_Name`,' ',`individual`.`Last_Name`). The lookup widget is searching on an empty result set. Any help would be greatly appreciated!
I'm trying to use a lookup widget on the following table and I'm having trouble finding much documentation on lookup widgets.
- Code: Select all
CREATE TABLE `entity` (
`Entity_ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Tax_ID` varchar(20) DEFAULT NULL,
`Parent_Entity_ID` int(10) unsigned DEFAULT NULL COMMENT 'Entity_ID of parent',
PRIMARY KEY (`Entity_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
The fields.ini file:
- Code: Select all
[Parent_Entity_ID]
widget:label = "Parent Entity"
widget:type=lookup
widget:table=entity_consolidated_vw
I was hoping I could use the view entity_consolidated_vw below to customize the lookup widget:
- Code: Select all
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `entity_consolidated_vw` AS select `business_org`.`Entity_ID` AS `Entity_ID`,`business_org`.`DBA` AS `Name` from `business_org` union select `individual`.`Entity_ID` AS `Entity_ID`,concat(`individual`.`First_Name`,' ',`individual`.`Last_Name`) AS `Name` from `individual` order by `Entity_ID`;
`entity` is the parent table to the `business_org` and `individual` tables. I want the lookup to place the Entity_ID into the Parent_Entity_ID field in the `entity` table and search based on the union of `business_org`.`DBA` and concat(`individual`.`First_Name`,' ',`individual`.`Last_Name`). The lookup widget is searching on an empty result set. Any help would be greatly appreciated!