Menu Close

Worker to User X++

Get User from Worker in X++

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;

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.