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:
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.
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);
You should use CompanyInfo table in SysReferenceGroup control.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 683 Most Valuable Professional
André Arnaud de Cal... 563 Super User 2025 Season 2
Sohaib Cheema 398 User Group Leader