Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

CONFIRM

(0) ShareShare
ReportReport
Posted on by

I need to state here if recSerialInformation.COUNT <> recSalesShipmentLine.Quantity then Confirm3365.14.PNG and bring up a message otherwise run the code below. How would I write that?

 

*This post is locked for comments

  • RE: CONFIRM

    Many Thanks!

  • Verified answer
    RE: CONFIRM

    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;

    
    
  • RE: CONFIRM

    .

  • RE: CONFIRM

    Thanks

  • Verified answer
    RE: CONFIRM

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans