How to Get Worker Information in Ax 2012

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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s