Parag Chapre

How to get current user worker in X++

How to get current user worker in X++

The code to get current user.

curUserId()

The code to get current user worker.

Option 1:

HcmWorkerRecId   hcmWorkerRecId =  HcmWorkerLookup::currentWorker();

Option 2:

HcmWorkerRecId   hcmWorkerRecId =  HcmWorker::userId2Worker(curUserId());

The code to get current worker name

DirPartyName workerName = HcmWorker::worker2Name(HcmWorker::userId2Worker(curUserId()));
Leave a Reply

Your email address will not be published. Required fields are marked *