Saturday, June 22, 2019

NAV CAL - How to update other fields after updating one field. Unable to change an earlier version of the record. The record should be read from the database again. This is a programming error.

This relates to the specific situation where a field on a list page causes other fields to update when ticked. The other fields do not immediately update when the tickbox is ticked.

Add this code on the page to get the latest version of the record, and maintain the value of the tickbox.

The "Errors" field is updated by other subscriptions when the "Confirmed by Vendor" is ticked.


Confirmed by Vendor - OnValidate()
IF "Confirmed by Vendor" = TRUE THEN BEGIN
  Rec.GET(Rec."PO Number");
  Errors := Rec.Errors;
  "Confirmed by Vendor" := TRUE;
END ELSE BEGIN
  Rec.GET(Rec."PO Number");
  Errors := Rec.Errors;
  "Confirmed by Vendor" := FALSE;
END;

No comments:

Post a Comment