I need to state here if recSerialInformation.COUNT <> recSalesShipmentLine.Quantity then Confirm and bring up a message otherwise run the code below. How would I write that?
*This post is locked for comments
I need to state here if recSerialInformation.COUNT <> recSalesShipmentLine.Quantity then Confirm and bring up a message otherwise run the code below. How would I write that?
*This post is locked for comments
Many Thanks!
Hi,
About the EXIT code, you can write like highlighted down here. Also, I rewrote your code. Hope it helps.
*******
IF recSerialNoInformation.COUNT <> recSalesShipnentline.Quantity THEN
BEGIN
IF CONFIRM('Are you sure?',TRUE) THEN
BEGIN
IF recSerialNoInformation.FINDSET(FALSE,FALSE) THEN
BEGIN
REPEAT
recSerialNoInformation2 := recSerialNoInformation;
recSerialNoInformation2."Shipment No." := recSalesShipmentLine."Document No.";
recSerialNoInformation2."Shipment Line No." := recSalesShipmentLine."Line No";
recSerialNoInformation2."Batch No." := '';
recSerialNoInformation2.MODIFY;
UNTIL recSerialNoInformation.NEXT = 0;
END;
recWhseSerialBatchheader.CALCFIELDS(Quantity);
IF recWhseSerialBatchheader.Quantity = 0 THEN
recWhseSerialBatchheader.DELETE;
END
ELSE EXIT;
END;
.
Thanks
Hi,
You can try like this. Text001 is a Text Constant, you can create like how you create a variable in the Text Constants tab of C/AL Globals or C/AL Locals.
IF recSerialNoInformation.COUNT <> recSalesShipmentLine.Quantity THEN
IF CONFIRM(Text001, TRUE) THEN
BEGIN
... // Your code goes here
END;
or else, your code be still legit if you say,
IF recSerialNoInformation.COUNT <> recSalesShipmentLine.Quantity THEN
IF CONFIRM('Do you want to confirm?', TRUE) THEN
BEGIN
... // Your code goes here
END;
Hope it helps.
André Arnaud de Cal...
292,516
Super User 2025 Season 1
Martin Dráb
231,407
Most Valuable Professional
nmaenpaa
101,156