web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

The 'with' statement is deprecated and will be removed for cloud development in a future release. This warning will become an error in a future release.[AL0606]

(0) ShareShare
ReportReport
Posted on by 256

Hi All,  

I used WITH Statement in AL  for some functionality, so I how can Solve the warning? for below code

  WITH PurchHeader DO BEGIN
            IF IsCreditDocType THEN BEGIN
                IF ("Applies-to Doc. Type" = "Applies-to Doc. Type"::Invoice) AND ("Applies-to Doc. No." <> ''THEN
                    WHTManagement.CheckApplicationPurchWHT(PurchHeader);

                IF (("Applies-to Doc. Type" = "Applies-to Doc. Type"::Refund) AND ("Applies-to Doc. No." <> '')) OR
                   ("Applies-to ID" <> '')
                THEN
                    WHTManagement.CheckApplicationPurchWHT(PurchHeader);
            END;

            IF "Document Type" IN ["Document Type"::Invoice] THEN BEGIN
                IF ("Applies-to Doc. Type" = "Applies-to Doc. Type"::"Credit Memo") AND ("Applies-to Doc. No." <> ''THEN
                    WHTManagement.CheckApplicationPurchWHT(PurchHeader);

                IF (("Applies-to Doc. Type" = "Applies-to Doc. Type"::Payment) AND ("Applies-to Doc. No." <> '')) OR
                   ("Applies-to ID" <> '')
                THEN
                    WHTManagement.CheckApplicationPurchWHT(PurchHeader);
            END;
        END;

 Thanks.

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    The new AL version 6.x has features for quick fixing the WITH obsoletion.

    More info here:

    demiliani.com/.../

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,990

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,576 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,028 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans