preloader-matrix

Alfasith

User ID to user name or Worker Name in AX 2012 / D365

Hi,

Worker = HcmWorker::find(DirPersonUser::findUserWorkerReference
(UserId));

or

public display Name userName()
{
DirPartyName        partyName;

partyName = DirPersonUser::userId2Name(this.UserId);
if (!partyName)
partyName = (select firstonly Name from userInfo where userInfo.Id == this.UserId).Name;
if (!partyName)
partyName = this.UserId;
return partyName;
}

Regards

Leave a Reply

Your email address will not be published.