Tuesday, 19 January 2016

Get current user name x++ AX 2012

when it is require to show current user name related with worker try below code in AX 2012.

static void getUserName(Args _args)
{
    info(strFmt('%1',curUserId()));
    
    info(strFmt('%1',HcmWorker::userId2Worker(curUserId())));
    
    info(HcmWorker::find(HcmWorker::userId2Worker(curUserId())).name());
}


This helped you..!! Then comment below..:)

No comments:

Post a Comment