Current user and its employee Name and department X++

static void curUserInfo(Args _arg)
{
str sUserId;
Name name;
str departmentName
;

;
sUserId = curUserId();
info( “Current user ID is ” + sUserId );
name= HcmWorker::find(DirPersonuser::findUserWorkerReference(sUserId)).name();
departmentName= HcmWorker::find(DirPersonuser::findUserWorkerReference(sUserId)).primaryDepartmentName();
info (“Name is ” + name);
}

Leave Comment

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