static void DAXPrintEmplDim(Args _args)
{
HcmWorker worker;
HcmEmployment employment;
#AviFiles
SysOperationProgress progressBar = new SysOperationProgress();
// Method to retuen dimension name
str getDefaultDimensionValue(RecId defaultDimension, Name dimName)
{
str 255 ret;
DimensionAttributeValueSetStorage dimStorage;
dimStorage = DimensionAttributeValueSetStorage::find(defaultDimension);
ret = dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName(dimName).RecId);
return ret;
}
// Initialising progress bar
progressBar.setCaption("Printing in progress...");
progressBar.setAnimation(#AviTransfer);
while select worker
{
progressBar.setText(strfmt("Employee %1", worker.name()));
employment = HcmEmployment::getActiveEmploymentsByWorker(worker.RecId);
if(employment.DefaultDimension)
{
info(strFmt("%1, %2, Department Value: %3", worker.PersonnelNumber, worker.name(), getDefaultDimensionValue(employment.DefaultDimension, "Department")));
}
}
}
{
HcmWorker worker;
HcmEmployment employment;
#AviFiles
SysOperationProgress progressBar = new SysOperationProgress();
// Method to retuen dimension name
str getDefaultDimensionValue(RecId defaultDimension, Name dimName)
{
str 255 ret;
DimensionAttributeValueSetStorage dimStorage;
dimStorage = DimensionAttributeValueSetStorage::find(defaultDimension);
ret = dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName(dimName).RecId);
return ret;
}
// Initialising progress bar
progressBar.setCaption("Printing in progress...");
progressBar.setAnimation(#AviTransfer);
while select worker
{
progressBar.setText(strfmt("Employee %1", worker.name()));
employment = HcmEmployment::getActiveEmploymentsByWorker(worker.RecId);
if(employment.DefaultDimension)
{
info(strFmt("%1, %2, Department Value: %3", worker.PersonnelNumber, worker.name(), getDefaultDimensionValue(employment.DefaultDimension, "Department")));
}
}
}