I would like to ask this, how i can filter or find the current worker financial dimension on employment history, in X++. i have this code which display all the Personnel Number and Business Unit of the workers.
public static void main(Args _args)
{
HcmEmployment hcmEmployment;
DimensionAttributeValueSetItem setItem;
DimensionAttributeValue dimAttrValue;
DimensionAttribute dimAttribute;
;
dimAttribute = DimensionAttribute::findByName('BusinessUnit');
anytype hcm = HcmWorker::find(HcmWorkerLookup::currentWorker()).PersonnelNumber;
ttsbegin;
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 = %1 %2 = %3 ",HcmWorker::find(hcmEmployment.Worker).PersonnelNumber, dimAttribute.Name, setItem.DisplayValue));
ttscommit;
}
Please Help me.