web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 135

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:

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at
    RE: look up event handler on form control

    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
    135 on at
    RE: look up event handler on form control

    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,827 Moderator on at
    RE: look up event handler on form control

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans