[X++] Find worker assigned to current user

To find the worker / employee of the current user in Dynamics AX 2012 you can use the currentWorker method of table DirPersonUser.
It returns the RecId of HcmWorker table.

HcmWorkerRecId workerRecId;
workerRecId = DirPersonUser::currentWorker();

Note:
Find out how to retrieve associated worker for a specific user here

Robin

Software Engineer / Application Developer

Subscribe to robsCode

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!