Hi guys,
I have a Form extension, that in its datasource it was added custom table. The issue now is I need to create some lookup in one of its field.
Is it do able by create CoC on FormDataSource of it ? or must create EventHandler class for it ?
I currently create CoC, but could not get it the correct way, as I found the field is still without lookup.
Here is the detail:
1. Main form (and table) is SubBillScheduleTable
2. In Form Extension, added my custom table TESTProductConfTable
3. Inside the table there is field named : ConfigurationID
4. So I wan to have this field having lookup to my ConfigurationTable (TESTConfigHeader)
I created CoC like this :
[ExtensionOf(formDataFieldStr(SubBillScheduleTable, TESTProductConfTable, ConfigurationId))
]
final class TESTSubBillScheduleTableFormDS_Extension
{
void lookup(FormControl _formControl, str _filterStr)
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(TESTProductConfTable), _formControl);
sysTableLookup.addLookupField(fieldNum(TESTConfigHeader, ConfigId));
sysTableLookup.addLookupField(fieldNum(TESTConfigHeader, Name));
sysTableLookup.addLookupField(fieldNum(TESTConfigHeader, Description));
queryBuildDataSource = query.addDataSource(tableNum(TESTConfigHeader));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
next lookup(_formControl, _filterStr);
}
}
Please advise.
Thanks