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

Announcements

No record found.

News and Announcements icon
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,172 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,865 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,098 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 898

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans