Tuesday, August 19, 2014

Get Current User Personnel Number In Dynamics

// First Method
static void GetCurrentUser(Args _args)
{
    str strPersonnel;
    strPersonnel = DirPersonUser::currentWorkerPersonnelNumber();
    info(strPersonnel);
}

//Second Method

static void GetCurrentUser(Args _args)
{
    str strPersonnel;
    //strPersonnel = DirPersonUser::currentWorkerPersonnelNumber();
   
   strPersonnel= HcmWorker::findByPerson(DirPersonUser::find(curUserId()).PersonParty).PersonnelNumber;
    info(strPersonnel);
   
}

No comments:

Post a Comment