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:

Regards,
Chaitanya Golla
*This post is locked for comments