Quantcast
Channel: AX Developer Forum
Viewing all articles
Browse latest Browse all 9880

To Update Default Dimension in Employee master_Ax 2012

$
0
0

hi all,

i want to update the default dimension in employee master after it has been created. i have used the code below. it is creating default dimension but not getting updated in the HCMEmployment table. Am i missing something?

employmentStartDateTime = DateTimeUtil::applyTimeZoneOffset(HcmDateTimeUtil::startOfCurrentDay

                                                   (),    DateTimeUtil::getUserPreferredTimeZone());
employmentEndDateTime   = DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::maxValue(), DateTimeUtil::getUserPreferredTimeZone());
hcmWorker = HcmWorker::findByPersonnelNumber(PersonnelNumber);
hcmEmployment = hcmEmployment::getActiveEmploymentsByWorker(hcmWorker.RecId, employmentStartDateTime, employmentEndDateTime, true);
if (hcmEmployment.RecId)
{

st.add('Divisions', '39');

ledgerDim += st.fields();
 ledgerDim += st.fieldName(1);
ledgerDim += st.valueIndex(1);
 hcmEmployment.DefaultDimension = AxdDimensionUtil::getDimensionAttributeValueSetId(ledgerDim);
 HcmWorkerTransition::newUpdateHcmEmployment(hcmEmployment, employmentStartDateTime, employmentEndDateTime);

}

 


Viewing all articles
Browse latest Browse all 9880

Trending Articles