How to get Product Dimension Group Name by giving Product Id/Item Id in Ax 2012

static void JK_FindProductDimensionGroupByItemId(Args _args)
{
InventTable it;
EcoResProductDimensionGroupProduct erpdgp;
EcoResProductDimensionGroup erpdg;

it=InventTable::find(“Johnkrishmaster”);

erpdgp=EcoResProductDimensionGroupProduct::findByProduct(it.Product);

erpdg=EcoResProductDimensionGroup::find(erpdgp.ProductDimensionGroup);

info(erpdg.Name);

}

 

OUTPUT

ColorStyle

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