...
IF "Automatic Cost Adjustment" <> "Automatic Cost Adjustment"::Never THEN BEGIN
Item.SETCURRENTKEY("Cost is Adjusted","Allow Online Adjustment");
Item.SETRANGE("Cost is Adjusted",FALSE);
Item.SETRANGE("Allow Online Adjustment",FALSE);
ProdOrderLine.SETCURRENTKEY(Status,"Cost is Adjusted","Allow Online Adjustment");
ProdOrderLine.SETRANGE(Status,ProdOrderLine.Status::Finished);
ProdOrderLine.SETRANGE("Cost is Adjusted",FALSE);
ProdOrderLine.SETRANGE("Allow Online Adjustment",FALSE);
IF Item.FIND('-') OR ProdOrderLine.FIND('-') THEN
MESSAGE(Text000);
END;
...
...
IF "Automatic Cost Adjustment" <> "Automatic Cost Adjustment"::Never THEN BEGIN
Item.SETCURRENTKEY("Cost is Adjusted","Allow Online Adjustment");
Item.SETRANGE("Cost is Adjusted",FALSE);
Item.SETRANGE("Allow Online Adjustment",FALSE);
// Add the following line.
UpdateRelProdOrderLine;
// End of the line.
ProdOrderLine.SETCURRENTKEY(Status,"Cost is Adjusted","Allow Online Adjustment");
ProdOrderLine.SETRANGE(Status,ProdOrderLine.Status::Finished);
ProdOrderLine.SETRANGE("Cost is Adjusted",FALSE);
ProdOrderLine.SETRANGE("Allow Online Adjustment",FALSE);
IF Item.FIND('-') OR ProdOrderLine.FIND('-') THEN
MESSAGE(Text000);
END;
...