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

Announcements

No record found.

News and Announcements icon
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 1,274

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,095 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
    1,274 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,095 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
    1,274 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
    1,274 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 657

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 615 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 356

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans