web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Look up event handler on form control

(0) ShareShare
ReportReport
Posted on by 166

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:

8081.pastedimage1685191519514v1.png

New added Field:

5076.pastedimage1685192032845v3.png

Relation based on which legal entity drop down is working:

2161.pastedimage1685192483884v5.png

Second table:

8156.pastedimage1685192296528v4.png

Drop-down:

  • Suggested answer
    GirishS Profile Picture
    27,843 Moderator on at

    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.

  • itlabnarmi_ivoruk Profile Picture
    166 on at

    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);

  • GirishS Profile Picture
    27,843 Moderator on at

    You should use CompanyInfo table in SysReferenceGroup control.

    Thanks,

    Girish S.

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 426 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 358

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 353 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans