Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Find a person based on current userId using standard methods of D365FO

Chaitanya Golla Profile Picture Chaitanya Golla 17,225

Hi,

In this post we will view the code to find the person name based on current user Id using standard methods of D365FO.

Created a runnable class DAXCurUserPerson(namely) and added below code.

class DAXCurUserPerson
{        
    /// 
    /// Runs the class with the specified arguments.
    /// 
    /// The specified arguments.
    public static void main(Args _args)
    {
        // Find a person based on current userId in D365FO
        Name  personName;
        
        personName = HcmWorker::worker2Name(HcmWorker::userId2Worker(curUserId()));
        info(strFmt("Person Name: %1", personName));
    }

}

Output:

DAXCurUserPersonOutput.jpg

Regards,

Chaitanya Golla

Comments

*This post is locked for comments