How to Get Worker Information in Ax 2012


Learn Dynamics Ax with Johnkrish

In Microsoft Dynamics AX 2012, hcmWorker table just consist of 2 fields. But from this table we can get many information about worker. For example to get name, phone, email, department, position, and Address is illustrated on below job.

static void Johnkrish_GetWorkerInfo(Args _args)
{
HcmWorker       Worker;
;
Worker = HcmWorker::findByPersonnelNumber(“000085”);
info(strFmt(“Name : %1”, Worker.name()));
info(strFmt(“Telepon : %1”, Worker.phone()));
info(strFmt(“Email : %1”, Worker.email()));
info(strFmt(“Departemen : %1”, Worker.primaryDepartmentName()));
info(strFmt(“Position : %1”, Worker.primaryPositionId()));
info(strFmt(“Address : %1”, Worker.primaryAddress()));
}

the result of this job is like this :

HCMWorkerInfo

View original post

Leave a comment