X++ code to find employee dimension
static void employeeDim(Args _args)
{
HcmEmployment hcmEmployment;
DimensionAttributeValueSetItem setItem;
DimensionAttributeValue dimAttrValue;
DimensionAttribute dimAttribute;
;
dimAttribute = DimensionAttribute::findByName('CostCenter');
while select hcmEmployment
join RecId, DisplayValue from setItem
where setItem.DimensionAttributeValueSet ==
hcmEmployment.DefaultDimension
join dimAttrValue
where dimAttrValue.RecId == setItem.DimensionAttributeValue &&
dimAttrValue.DimensionAttribute == dimAttribute.RecId &&
dimAttrValue.IsDeleted == false
{
info(strFmt("Employee personnel number = %1 %2 = %3 ",
HcmWorker::find(hcmEmployment.Worker).PersonnelNumber,
dimAttribute.Name, setItem.DisplayValue));
}
}
No comments:
Post a Comment