Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Reporting Manager's details for an employee

Posted on by 572

Hi Experts,

I need to fetch the email address of an employee's manager in my code. I am having employee's personnel number and I can use HCMWorker.email() for employee's email, sameway would be the simplest code to fetch the reporting manager's email Id ?

Thanks in advance. 

  • D365  beginner Profile Picture
    D365 beginner 572 on at
    RE: Reporting Manager's details for an employee

    Hi Will,

    Thanks for your comment, I need to get the employee's reporting manager's email Id. Consider Employee A is reporting to Employee B, I need to get the Email of Employee B. (Position is set by standard position hierarchy  in AX)

  • Verified answer
    WillWU Profile Picture
    WillWU 22,350 on at
    RE: Reporting Manager's details for an employee

    Hi AX Beginner,

    Yes, you could use this code to get the email of workers:

    HcmWorker Worker;
    
    Worker = HcmWorker::findByPersonnelNumber(“Number”);
    
    info(strFmt(“Email : %1”, Worker.email()));

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans