I am deleting Sales Order line OnBeforeReopenSalesDoc Event , Below are the coding using to delete the Sales Order line . After deleting the sales order line its not refresh the sales order /Total amount/ and /Total amount Incl GST/ fields. But actually value updated, when go back to Sales Order list and come back to Sales Order again, I can see the correct value in Total Value section. Problem is when click the ReOpen button delete the line , but can't see updated value in Total section, seems page not refresh
Could you please help to sort out this issue ?
if SalesHeaderRec.GET(SalesHeader./Document Type/, SalesHeader./No./) then begin
SalesLineRec.SETRANGE(/Document No./, SalesHeader./No./);
if SalesLineRec.FINDSET() then begin
repeat
if SalesLineRec./No./ = '8640' then begin
SalesLineRec.DELETE;
end;
until SalesLineRec.NEXT = 0;
end;
end;