Thursday, February 23, 2017

Get Worker to User Id in ax 2012

//Get Worker to User Id in ax 2012


public static UserID Worker2UserId(HcmWorkerRecId _WorkerRecId) // Added by ISYX
{
    DirPersonUser   personUser;
    HcmWorker       worker;
     select User from personUser
         exists join worker
            where worker.Person == personUser.PersonParty
                    && worker.RecId == _WorkerRecId;
   
    return personUser.User;
}

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...