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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How can I auto-populate the employee name when selecting the employee ID, like the standard system?

(3) ShareShare
ReportReport
Posted on by 62
I am working on a custom form in Dynamics 365 F&O, where I have set up a relation between the HCMWorker(PersonnelNumber) and CustomTable(EmployeeID) fields.
In the relation field dropdown, both PersonnelNumber and Name are appearing, which indicates that the name is being pulled from somewhere.
 
Now I want to populate employee name field when the employee id is selected, for that purpose I can use OnModified method, but I want to use systems functionality to do that using no code because I've seen in multiple forms like in SalesLine when we select itemId all the related fields gets populated. 
 
How can I auto-populate the employee name when the employee ID is selected, similar to the standard system behavior?
image (1).png
I have the same question (0)
  • Suggested answer
    Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi,
     
    Do you want to show the name of worker instead of the Id? if yes, then you can make the relation based on Recld with HcmWorker table.
     
    If you want to create new field for name on your table then, you can use modified method to set it.
     

     

    Thanks,

    Waed Ayyad

    If this helped, please mark it as "Verified" for others facing the same issue

     
  • Arabic Translation with item Profile Picture
    62 on at
    Hi Waed, 

    Thank you for your response.

    I want to select the employee ID, and based on that, automatically populate the 'Employee Name' field next to it, both are separate fields.

    And I don't want to use method.
  • Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at
    If you use the relation over RecId, you can show both the ID and the name (by using an appropriate field group).
     
    If you want duplicate the name in your table (which isn't the recommended design), you need code to set its value.
     
    If you reject both solution, then your requirements can't be met.
     
    Another possible approach would be using a display method (which violates your requirements of using a field and not using a method).
     
    In general, you should focus on business requirement, not your arbitrary implementation decisions. You seemed designed your data model before understanding your options, and doing object-oriented programming without methods is just silly.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi,
     
    You can achieve it using modified method, but this is recommended as you duplicate information you already have on Homeworker table. 
    If you want the name field as an information then I find the display method fit your requirement, but if you want it on List Page form, then display method is not good choice as it slows the loading of the form if you have a lot of records.
     
     

    Thanks,

    Waed Ayyad

    If this helped, please mark it as "Verified" for others facing the same issue

  • André Arnaud de Calavon Profile Picture
    301,210 Super User 2025 Season 2 on at
    Hi Arabic Translation,

    When I read your question, you ask about a behavior like itemId selection on the sales order line. All fields that gets populated after the selection, is managed with X++ coding. This is not "no code" you are assuming. 
     
    Anyway you would need to use coding to achieve your requirement. I do agree with Martin that the design is wrong. I would recommend using a record ID reference to the HCMWorker table. In case you copy the worker name, you would also need additional extensions to update your custom table in case the name of a worker will be updated. 
  • Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at

    Hi, 

    Is your issue resolved? If yes, mark the answers that helped you as verified. 

    Thanks,

    Waed Ayyad

  • Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at

    Hi, 

    Is your issue resolved? If yes, mark the answers that helped you as verified. 

    Thanks,

    Waed Ayyad

  • Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at

    Hi, 

    Is your issue resolved? If yes, mark the answers that helped you as verified. 

    Thanks,

    Waed Ayyad

  • Vahid Ghafarpour Profile Picture
    12,202 Super User 2025 Season 2 on at
    If any of the responses helped resolve your issue, please take a moment to mark the best answer. This helps others in the community quickly find solutions to similar problems.

    To do this, simply click the "Does this answer your question?" button on the most helpful response and like the helpful posts. If your issue is still unresolved, feel free to provide more details so the community can assist further!

    Thanks for being an active part of the Dynamics 365 Community! 😊

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
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 384 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans