preloader-matrix

Alfasith

ERROR : Update is not allowed without specifying ValidTimeStateUpdateMode in AX 2012 / D365

Hi,

Add tableName.validTimeStateUpdateMode(ValidTime
StateUpdate::Correction);

 
inside the tts.

static void Job511(Args _args)
{
EmplContract     emplContract;
utcdatetime minDateTime = DateTimeUtil::minValue() , maxDateTime = DateTimeUtil::maxValue();
ttsBegin;
While select forUpdate
* from emplContract
where emplContract.AnnualLeave == “”
{
emplContract.validTimeStateUpdateMode(ValidTime
StateUpdate::Correction);

emplContract.AnnualLeave = “اجازة السنوية”;
emplContract.update();
}
ttsCommit;
}

Regards

Leave a Reply

Your email address will not be published. Required fields are marked *