Hello Community Members -
I had seen similar posts to this error, but didn't seem to find a solution yet. When I am trying to execute the below code in my Job Queue I get an error message pasted in color
1. There is a repeat until above this code with some basic filters
2. CUPostSalesInvoiceUtility is a codeunit which creates and posts a sales invoice. Whenever an error occurs, it will satisfy the ELSE condition. A simple error handling scenario
I get the error when the code hits the MODIFY in the ELSE Section, second time. The first time it hits the MODIFY in the ELSE section, no error. The record with each loop is getting changed, I verified that
if CUPostSalesInvoiceUtility.Run() then begin
RecWMSSalesHeader./Processing Status/ := RecWMSSalesHeader./Processing Status/::Success;
RecWMSSalesHeader./Processing Status Details/ := 'Transaction Created Successfully.';
RecWMSSalesHeader./Processing Status D/T/ := CurrentDateTime;
RecWMSSalesHeader.Modify();
end else begin
RecWMSSalesHeader./Processing Status/ := RecWMSSalesHeader./Processing Status/::Failure;
RecWMSSalesHeader./Processing Status Details/ := GetLastErrorText();
RecWMSSalesHeader.Modify();
end;
ERROR
The changes to the record cannot be saved because some information on the page is not up-to-date. Close the page, reopen it, and try again.