2018-10-31

[AX2012] Comparing Two Record

To compare the original and updated (dirty) record, use equal method. Do this below method before write the table record.
void modifiedRecord()
{
    ;
    //in not equal, update user or manager update field
    if(!(MIOSQTable.orig().equal(MIOSQTable)) || !(MIOSQVendReply.orig().equal(MIOSQVendReply)))
    {
        if(isUser)
            MIOSQTable.UserUpdate = NoYes::Yes;
        if(isManager)
            MIOSQTable.ManagerUpdate = NoYes::Yes;
    }
}