Hi
I would appreciate if you could provide a video on how to implement a picklist for a FK field in a table inside a form and grid section.
Thanks & Best Regards
Printable View
Hi
I would appreciate if you could provide a video on how to implement a picklist for a FK field in a table inside a form and grid section.
Thanks & Best Regards
Hi Tekhong,
Use the Choices attribute and specify a SQL Select statement. For numeric fields, use the Choices + Get data mapping / Set data mapping as demonstrated in the example_datamapping App.
Attachment 545
Regards,
Yvonne
Hi Yvonne
Thanks but is there a situation we need to set both "Choices" and "Data Mappings"?
Or is it the case of either "Choices" or the "Get/Set Mapping" setting?
Thanks & Best Regards
Hi Tekhong,
Taking the southwind orders table as an example, it contains the customerid field, e.g. 'ALFKI'. For that, I would just use choices - select customerid from customers - and include an 'order by' or 'where' clause if required. The orders table also has employeeid. If I wanted to display the lastname of the employee, rather than their id, I would use data mapping to display the lastname (Get data mapping) and my select statement would be based on the lastname. I would use the Set data mapping to store the employeeid for the selected lastname back to the table.
So if you just want to display a choice list, just use choices and if you want to display a name or a description associated with an id (another field in the lookup table), use the get/set data mapping as well.
Regards,
Yvonne
Hi Yvonne
If a have a PK that is related to many tables through FK in these tables, is there a way to setup the choices and get/set data mapping once or do I have to repeat the settings in all the sections that has the FK field. In my case, employee ID exist as a FK field in about 100+ tables. So do I have to do the same setup 100+ times?
Your advice is much appreciated
Thanks & Best Regards