How To Set Next RecId X++ D365fo
static void SetNextRecId(Args _args) { SystemSequences seq; ttsBegin; select firstonly forupdate crosscompany seq where seq.tabId == 97; // use the table id here or tablenum() seq.skipTTSCheck(true); seq.skipDatabaseLog(true); seq.selectForUpdate(true); seq.nextVal = 5637162523 + 1; // enter the last recId for the table seq.update(); ttsCommit; }
This Code Written By Mohamed Elsagher
Comments
Post a Comment