I have added new legal entity drop down field which shows legal entities based on relationship with company info(No lookup method behind). The field behind legal entity form control is CompanyInfo RecId field. I have another table which contain CompanyInfo RecId and some other field. I want the legal entity drop down will only shows those legal entities which are in second table. I can find second table based on job field selection. In other words I just want to add range(Drop-down only shows those legal entity which are in second table) on relationship based dropdown.
FormControl:
New added Field:
Relation based on which legal entity drop down is working:
Second table:
Drop-down:
You should use CompanyInfo table in SysReferenceGroup control.
Thanks,
Girish S.
Which table should provide to SysReferenceGroupControl as parameter ?
[FormControlEventHandler(formControlStr(HcmPositionNewPosition, HcmPositionDetail_CompanyInfo), FormControlEventType::Lookup)] public static void HcmPositionDetail_CompanyInfo_OnLookup(FormControl sender, FormControlEventArgs e)
{
SysReferenceTableLookup sysTableLookup =SysReferenceTableLookup::newParameters(tableNum(HcmPositionDetail/CompanyInfo), sender);
Hi,
You need to write lookup event handler and use SysReferenceGroupControl class for the lookup.
First you need to add CompanyInfo table to the query and then add the new table where you have created the field CompanyInfo. Using addLink method you can refer the relationship between two tables. Add the Job field as range to it which will be given in the position creation form.
Thanks,
Girish S.
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156