HcmWorkerRecId hcmWorkerRecId = HcmWorkerLookup::currentWorker(); HcmWorker::userId2Worker(curUserId());HcmWorker::worker2Name(HcmWorker::userId2Worker(curUserId()));
Category: Current User
D365FFO / AX – Get Current User Name – X++
This function will return the name associated with the current user. If you just want the current user ID, use curUserId() XUserInfo::find(false, curUserId()).name;