Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Wednesday, October 23, 2019

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

Hi,

Add tableName.validTimeStateUpdateMode(ValidTimeStateUpdate::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(ValidTimeStateUpdate::Correction);
        emplContract.AnnualLeave = "اجازة السنوية";
        emplContract.update();
    }
    ttsCommit;
}

Regards

No comments:

Post a Comment

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...