Notifications
Announcements
No record found.
How can i get User Profile ID for the currently logged in user in X++ code in AX 2012?
*This post is locked for comments
info((select firstonly ProfileId from SysUserProfiles where SysUserProfiles.UserId == curUserId()).ProfileId);
Hi Vilmos,
Thanks a lot. Since i am new in AX, could you please provide complete syntax to get user profile id and store it in a string variable? Please note, i need to create this method/file in code behind of a Data Set.
Hi,
Could you provide some more information regarding "create method in code behind of a data set" means.
Code to save it to a variable:
ProfileId profileId; // Variable declaration
select firstonly ProfileId from SysUserProfiles where SysUserProfiles.UserId == curUserId();
ProfileId = SysUserProfiles.ProfileId;
Thanks,
Chaitanya
You would replace the info method call with a variable assignment instead. Find the Extended Data Type behind the field in the table mentioned above, and use that as the variable.
Thank you. I have achieved my requirement.
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 Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2