Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

find userid using the emplid

(0) ShareShare
ReportReport
Posted on by 793

Hello everyone,

I have a bunch of emplIDs and I need to find userId for each of them.

I use the following code:

SysCompanyUserInfo::emplId2UserId(emplid);

The thing is that for some EMPLIDs it returns UserID and for others it returns empty string. Is it possible? I thought if user has got emplId It will have some UserID for sure.

Thanks.

  • dark_knight Profile Picture
    dark_knight 793 on at
    RE: find userid using the emplid

    Yes. Just found it by myself) Thank you.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: find userid using the emplid

    Hi Azat,

    In AX 2009, you have a mthod email() in EmplTable. Are you not able to use that?

  • dark_knight Profile Picture
    dark_knight 793 on at
    RE: find userid using the emplid

    Hi Sergei,

    There is no HCMWoker table in AX2009:((

  • Verified answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,091 on at
    RE: find userid using the emplid

    Hi Azat,

    Not sure about AX 2009, but in AX 2012 there is a email method on HcmWorker table which returns you a primary email for Employee (but it should be set up for employee).

  • dark_knight Profile Picture
    dark_knight 793 on at
    RE: find userid using the emplid

    Thank you guys. Got it. IN that case how can I get such employee's e-mail? Because I search userid actually for getting e-mail of the employee like that

    SysUserInfo::find(userId, false).Email

    This way is described everywhere

    https://ax2012anant.blogspot.com/2014/05/get-employee-email-with-x.html

    but it seems if employee can have no userid in the system then that's not the best solution?

  • Suggested answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,091 on at
    RE: find userid using the emplid

    Hi Azat,

    There is "Relations" button on "Users" form where you can specify relation to an employee record. If certain employee record is not assigned to any user, you will get an empty string.

  • Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: find userid using the emplid

    Hi Azat,

    That's not necessary. Some employees might not have user Id in AX as they don't use AX for anything. It's not a mandatory relation and hence you can always get blank values for some employee Ids.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,309 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans