Get Current User and Employe Infomation



Retrieves the nonnumeric ID that represents the current user.

curUserId();   

Following function will return the name associated with the current user.

XUserInfo::find(false, curUserId()).name;    

In order find out the employee linked to the current user. AX 2009:

EmplTable::find(SysCompanyUserInfo::find(curUserId()).EmplId);    

AX 2012:

HcmWorker::find(DirPersonuser::findUserWorkerReference(curUserId())).name();      

Comments

Popular posts from this blog

X++ Get Start Date and End Date of Month

Dynamics AX 365 : The name does not denote a class, a table or an extended data type

Error while setting server report parameters. Error message: The permissions granted to user are insufficient for performing this operation. (rsAccessDenied)