Event OnBeforeConfirmExplosion to C63 Sales-Explode BOM
Can we refactor this section of OnRun from
FromBOMComp.SETRANGE("Parent Item No.","No."); NoOfBOMComp := FromBOMComp.COUNT; IF NoOfBOMComp = 0 THEN ERROR( Text001, "No.");
Selection := STRMENU(Text004,2); IF Selection = 0 THEN EXIT;
to be closer to match the pattern in the Post + Print codeunits now please i.e.
OnBeforeConfirmExplosion(SalesLine,Selection,HideDialog); IF NOT HideDialog THEN BEGIN FromBOMComp.SETRANGE("Parent Item No.","No."); NoOfBOMComp := FromBOMComp.COUNT; IF NoOfBOMComp = 0 THEN ERROR( Text001, "No.");
Selection := STRMENU(Text004,2); IF Selection = 0 THEN EXIT; END;
Use case is that it allow us to control where the dimension come from without user input.
Would also be good if we could have an event as follows
IF SalesHeader."Language Code" = '' THEN
ToSalesLine.Description := FromBOMComp.Description
ELSE
IF NOT ItemTranslation.GET(FromBOMComp."No.",FromBOMComp."Variant Code",SalesHeader."Language Code") THEN
ToSalesLine.Description := FromBOMComp.Description;
ToSalesLine."BOM Item No." := BOMItemNo;
OnInsertOfExplodedBOMLineToSaleLine(ToSalesLine,SalesLine,FromBOMComp);
ToSalesLine.INSERT;
ToSalesLine.VALIDATE("Qty. to Assemble to Order");
Use case is it allows us to transfer any additional fields for the exploded lines.