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.
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.
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.
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?
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).
Hi Sergei,
There is no HCMWoker table in AX2009:((
In AX 2009, you have a mthod email() in EmplTable. Are you not able to use that?
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 2,167
André Arnaud de Cal... 867 Super User 2025 Season 2
Sohaib Cheema 617 User Group Leader