ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[EventRequest] Codeunit 5407Prod. Order Status Management FlushProdOrder function

Open RishtaCader opened this issue 7 years ago • 2 comments

Hello,

We need a new event in the Codeunit 5407 (OnAfterCheckAndUpdate) :

WITH ProdOrderComp DO BEGIN SETCURRENTKEY(Status,"Prod. Order No.","Routing Link Code","Flushing Method"); IF NewStatus = NewStatus::Released THEN ..... REPEAT LineCount := LineCount + 1; Item.GET("Item No."); Item.TESTFIELD("Rounding Precision"); Window.UPDATE(1,LineCount); Window.UPDATE(2,ROUND(LineCount / NoOfRecords * 10000,1)); ProdOrderLine.GET(Status,ProdOrder."No.","Prod. Order Line No."); IF NewStatus = NewStatus::Released THEN QtyToPost := GetNeededQty(1,FALSE) ELSE QtyToPost := GetNeededQty(0,FALSE); // New event request >> OnAfterCalculateQtyToPost(QtyToPost); // New event request << QtyToPost := ROUND(QtyToPost,Item."Rounding Precision",'>');

Signature :

LOCAL [IntegrationEvent] OnAfterCalculateQtyToPost(Var QtyToPost: Decimal)

Thank you Kind Regards

RishtaCader avatar Aug 08 '19 08:08 RishtaCader

You already have needed event in GetNeededQty, why do you need this one?

OnGetNeededQtyOnAfterCalcBasedOn(Rec); EXIT(ROUND("Remaining Quantity",Item."Rounding Precision"));

AlexanderYakunin avatar Aug 08 '19 13:08 AlexanderYakunin

Hello,

We have to bypass the validation on the NewStatus, thus the QtyToPost is calculated based only on the GetNeededQty(1,FALSE).

Thank you, Kind Regards.

RishtaCader avatar Aug 09 '19 05:08 RishtaCader