ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Refactor OnAfterPostUpdateWhseRcptLine in CU5760

Open GuntherGebauer opened this issue 7 years ago • 1 comments

In CU5760 the Trigger OnAfterPostUpdateWhseRcptLine is wrongly placed - the WhseRcptLine2might be deleted. In NAV2018 the trigger was placed correctly where the Line is not deleted, but should be placed before the WhseRcptLine2.MODIFY:

PROCEDURE PostUpdateWhseDocuments BC130: OnBeforePostUpdateWhseRcptLine(WhseRcptLine2,WhseRcptLineBuf,DeleteWhseRcptLine); IF DeleteWhseRcptLine THEN WhseRcptLine2.DELETE ELSE BEGIN WhseRcptLine2.VALIDATE("Qty. Received","Qty. Received" + "Qty. to Receive"); WhseRcptLine2.VALIDATE("Qty. Outstanding","Qty. Outstanding" - "Qty. to Receive"); WhseRcptLine2."Qty. to Cross-Dock" := 0; WhseRcptLine2."Qty. to Cross-Dock (Base)" := 0; WhseRcptLine2.Status := WhseRcptLine2.GetLineStatus; WhseRcptLine2.MODIFY; END; OnAfterPostUpdateWhseRcptLine(WhseRcptLine2);

NAV2018: OnBeforePostUpdateWhseRcptLine(WhseRcptLine2); IF "Qty. Outstanding" = "Qty. to Receive" THEN WhseRcptLine2.DELETE ELSE BEGIN WhseRcptLine2.VALIDATE("Qty. Received","Qty. Received" + "Qty. to Receive"); WhseRcptLine2.VALIDATE("Qty. Outstanding","Qty. Outstanding" - "Qty. to Receive"); WhseRcptLine2."Qty. to Cross-Dock" := 0; WhseRcptLine2."Qty. to Cross-Dock (Base)" := 0; WhseRcptLine2.Status := WhseRcptLine2.GetLineStatus; WhseRcptLine2.MODIFY; OnAfterPostUpdateWhseRcptLine(WhseRcptLine2); END; UNTIL NEXT = 0;

GuntherGebauer avatar Jan 22 '19 11:01 GuntherGebauer

compare CU5760 with CU5763, CU5763 the trigger OnAfterPostUpdateWhseShptLine in PostUpdateWhseDocuments is correctly placed, whereas here in cu5760 it is wrongly placed

GuntherGebauer avatar Jan 22 '19 12:01 GuntherGebauer