When this runs and the user selects Yes the code doesn't actually execute. How can i re write this to allow it to run if the user selects yes and exits if the user selects no from the CONFIRM box?
Thanks
*This post is locked for comments
When this runs and the user selects Yes the code doesn't actually execute. How can i re write this to allow it to run if the user selects yes and exits if the user selects no from the CONFIRM box?
Thanks
*This post is locked for comments
Hey Lewish,
You should write
If NOT CONFIRM('Are you Sure',TRUE) THEN
EXIT;
So that if the users select YES then your next piece of code get's executed.
Only Add "not" before the "confirm".
Hi,
Were you able to do it?
Hello Lewishhh,
You have to change just couple of lines, see the bellow screenshot.
Write
IF NOT CONFIRM('Are you sure?',false) THEN
exit
Else
... // your code to Run
Hi,
Your code should work. But I rewrote your code. Just try this.
*******
IF recSerialNoInformation.COUNT <> recSalesShipnentline.Quantity THEN
BEGIN
IF CONFIRM('Are you sure?',TRUE) THEN // Parameter is set to TRUE
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; // Exit code
END;
Hope it helps.