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, ...
Answered

find userid using the emplid

(0) ShareShare
ReportReport
Posted on by 942

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.

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    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.

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    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.

  • dark_knight Profile Picture
    942 on at

    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?

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    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
    942 on at

    Hi Sergei,

    There is no HCMWoker table in AX2009:((

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

    Hi Azat,

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

  • dark_knight Profile Picture
    942 on at

    Yes. Just found it by myself) Thank you.

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 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans