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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to display Username and respected email id in D65 F&O

(0) ShareShare
ReportReport
Posted on by

Hello Experts,

I have one requirement , i am displaying user name in one of my field by defining relation in my table using  reference group. now user names are displaying well , i want when i chose any user respected email id of that user should be display. i found email id for all the user  in SYSUSERINFO table. but i am not able to find any relation of SYSUSERINFO table with HCMworker Table or DIRPARTYTABLE table. 

i am planning to display this email using look up method by defining QueryBuildDataSource , one i found the relation. Please advise any other way if possible. below is the screen shot how i am displaying username(Assignee)

1. Relation in Table 

8473.Capture11.PNG

2. field on Form

Capture12.PNG

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,401 Super User 2025 Season 2 on at

    Hi Sachin,

    If the workers are maintained in your environment including the email as contact information, you can use the method email() on the HCMWorker table to show the email address.

    If you really need the email from the SysUserInfo table, Then you have to link the worker to the user using the next tables and their relations:

    HCMWorker > DirPerson > DirPersonUser > SysUserInfo.

  • Community Member Profile Picture
    on at

    Hello Andre,

    Thank you so much for your suggestion. can you please guide me more about the email(). we have worker maintained. at the time of initialization , i want logged in user email should appear.

    similar way i am getting user name by using initvalue()  , like this

    this.ReportedByUser=HcmWorker::worker2Name(HcmWorker::userId2Worker(curUserId()));

    when i am trying same with email it says , static method email() doesnt contain. please advise

  • Verified answer
    Martin Dráb Profile Picture
    238,067 Most Valuable Professional on at

    You can get worker's email from HcmWorker.email(). User's email is in SysUserInfo.Email.

  • Community Member Profile Picture
    on at

    Hello Marten and Andre ,, This is done i am writing below code on my table initValue() method.

     This.Fromemail = Hcmworker::find(HcmWorker::userid2worker(curUserId())).email();

    on my second requirement for Assignee email ,  where i am displaying username(AssigneeName) using relation and referencegroup. how should i link it will assignee name so that when user will chose assignee the respected email will appear in the email field. Please advise on this , for more details you can check screen shot in the same thread first query.

  • Verified answer
    Martin Dráb Profile Picture
    238,067 Most Valuable Professional on at

    It depends on what you're doing and, unfortunately, you told us very little about it.

    If you're developing a custom form, your reference group is bound to a table and you want this logic in all forms, put the initialization to modifiedField() method on the table.

    If you're doing something else, e.g. create a dialog, you may need another approach.

    By the way, is there any reason for attaching the tag ".NET" to your last reply?

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Sachin,

    You can write a display method for this. If you are looking to display the email from user details, you can use this code in the display method -

    SysUserInfo::find(HcmWorker::findPersonUser(NCRTable.Assignee).User).Email

  • Community Member Profile Picture
    on at

    Hello Mr. Gunjan,  Thank you so much for the advise. i need this filed to be store data in the table as i am writing modified method on the table level using the same code you have mentioned and its working fine as per my requirement.

    Thanks a lot , good day

  • Community Member Profile Picture
    on at

    Hello Martin, thanks for the comments ,  I am writing this modified method on table level as i want this logic in this form for now.

    .NET was mistakenly chosen.

  • Martin Dráb Profile Picture
    238,067 Most Valuable Professional on at

    Does it mean that you're successfully using modifiedField() and your question is answered, or do you still have a problem?

  • Community Member Profile Picture
    on at

    No, problem has been solved now  Martin.

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

News and Announcements

Season of Giving Solutions is Here!

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 679 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 264 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans