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

Community site session details

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

Breaking Change in BC26.1

(4) ShareShare
ReportReport
Posted on by 519
Currently on BC26 SaaS. I have a custom extension, where I received a warning about that breaking change when the BC26.1 update is installed in the environment. Specifically, it's about a page extension for the Posted Sales Invoice Lines list page. The warning states Error AL0155: A member of type Field with name 'Order No.' is already defined in Page 'Posted Sales Invoice Lines' by the extension 'Base Application by Microsoft (26.1.33399.0)'.
 
Below is my AL code:
 
/// <summary>
/// PageExtension DCH Posted Sales Invoice Lines (ID 50194) extends Record Posted Sales Invoice Lines.
/// </summary>
pageextension 50194 "DCH Posted Sales Invoice Lines" extends "Posted Sales Invoice Lines"
{
    layout
    {
        addafter("Line Discount %")
        {
            field("Order No."; Rec."Order No.")
            {
                ApplicationArea = All;
            }
            field("Order Line No."; Rec."Order Line No.")
            {
                ApplicationArea = All;
            }
        }
    }
}
Rather than wait until the BC26.1 update is scheduled to be applied and push an extension update just prior, what would be the standard method to include preprocessor directives to ignore this one field depending on the runtime version? I have read about employing CLEANxx type references, but these appears to involve major versions. Like CLEAN21, CLEAN22, etc. Any suggestions? 
I have the same question (0)
  • Greg Kujawa Profile Picture
    519 on at
    Breaking Change in BC26.1
    I think I know what to do now. I can define the preprocessorSymbols in the app.json file. And use the #if and #endif blocks to conditionally include or exclude what is needed. I can use CLEAN261 or whatever preprocessor value I wish, correct?
  • Suggested answer
    Greg Kujawa Profile Picture
    519 on at
    Breaking Change in BC26.1
    Here is what I added to the app.json file.
     
    "preprocessorSymbols": ["BC26"]
     
    And here is what I have in the page extension.
     
    /// <summary>
    /// PageExtension DCH Posted Sales Invoice Lines (ID 50194) extends Record Posted Sales Invoice Lines.
    /// </summary>
    pageextension 50194 "DCH Posted Sales Invoice Lines" extends "Posted Sales Invoice Lines"
    {
        layout
        {
            addafter("Line Discount %")
            {
    #if BC26
                field("Order No."; Rec."Order No.")
                {
                    ApplicationArea = All;
                }
    #endif
                field("Order Line No."; Rec."Order Line No.")
                {
                    ApplicationArea = All;
                }
            }
        }
    }
     
    So that way the next BC26.1 minor version update can be compiled with the preprocessorSymbol set to BC261. So that field will be skipped over. Should work, right?
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,087 Super User 2025 Season 2 on at
    Breaking Change in BC26.1
    Yes, you are absolutely correct about using preprocessor directives, and there IS a CLEAN26 directive available for this exact scenario. Here's the correct way to modify your code:
     
    /// <summary>
    /// PageExtension DCH Posted Sales Invoice Lines (ID 50194) extends Record Posted Sales Invoice Lines.
    /// </summary>
    pageextension 50194 "DCH Posted Sales Invoice Lines" extends "Posted Sales Invoice Lines"
    {
        layout
        {
            addafter("Line Discount %")
            {
    #if not CLEAN26
                field("Order No."; Rec."Order No.")
                {
                    ApplicationArea = All;
                }
    #endif
                field("Order Line No."; Rec."Order Line No.")
                {
                    ApplicationArea = All;
                }
            }
        }
    }
     
     

    The error AL0155 occurs when "A member of type Field with name 'Order No.' is already defined in Page 'Posted Sales Invoice Lines' by the extension 'Base Application by Microsoft'" How to handle AL0155 (object already defined) without using "Next Major Version" option in Extension Management - Developers Forum - Dynamics User Group - this means Microsoft has added the "Order No." field to the Posted Sales Invoice Lines page in BC26.1.

     

    The #if not CLEAN26 directive will:


    • Include the "Order No." field in BC26.0 and earlier versions

    • Exclude the "Order No." field in BC26.1 and later versions (where Microsoft has already added it)


    •  
     

    Important Notes


    1. CLEAN26 exists: While you mentioned reading about CLEAN21, CLEAN22, etc., the CLEAN26 directive is available for BC26 breaking changes.

    2. Keep "Order Line No.": Notice that only the "Order No." field is wrapped in the conditional directive. The "Order Line No." field remains unchanged because Microsoft hasn't added this field to the base page.

    3. Runtime Detection: The preprocessor directive is evaluated at compile time based on the target platform version, not at runtime.


    4.  
     

    This is the standard Microsoft-recommended approach for handling breaking changes where Microsoft adds fields that conflict with existing extension fields. The solution ensures your extension works correctly across both BC26.0 and BC26.1+ versions without requiring separate extension versions.

     

     

    Mark below checkbox to make this answer Verified if it helps you.

  • Suggested answer
    YUN ZHU Profile Picture
    92,656 Super User 2025 Season 2 on at
    Breaking Change in BC26.1
    Hi, hope the following can give you some hints as well.
    Dynamics 365 Business Central: Preprocessor Directives in AL (Conditional Directives, Regions, Pragmas)
     
    Thanks.
    ZHU
  • Verified answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,207 Super User 2025 Season 2 on at
    Breaking Change in BC26.1
    When adding a field, you need to add prefix or suffix. Otherwise you can end up clashing with Microsoft Base App.
     
    pageextension 50194 "DCH Posted Sales Invoice Lines" extends "Posted Sales Invoice Lines"
    {
        layout
        {
            addafter("Line Discount %")
            {
                field("DCH Order No."; Rec."Order No.")
                {
                    ApplicationArea = All;
                }
                field("DCH Order Line No."; Rec."Order Line No.")
                {
                    ApplicationArea = All;
                }
            }
        }
    }
  • Greg Kujawa Profile Picture
    519 on at
    Breaking Change in BC26.1
    Appreciate everyone's insight. To simplify things and eliminate the need for compiling different extensions depending on the environment version, I just renamed the the custom field name to avoid conflicts. When BC26.1 is installed then I will just remove this custom field entirely, since it will essentially be a duplicate in the list page UI.
     
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    19,139 Super User 2025 Season 2 on at
    Breaking Change in BC26.1
    In AL development for Business Central, adding custom fields without a prefix or suffix is strongly discouraged, especially on base pages or tables, because Microsoft may introduce fields with the same name or caption in future versions, leading to runtime conflicts such as AL0155: Duplicate field definition. Using a prefix or suffix (e.g., "DCH Order No.") ensures namespace isolation, avoids clashes with the Base App, and provides long-term maintainability and future-proofing of custom extensions.
  • Gerardo Rentería García Profile Picture
    23,574 Most Valuable Professional on at
    Breaking Change in BC26.1
    Hi
    You could also comment out your code and temporarily lose this functionality until the standard displays that field.
    Best
    GR

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,232

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,863

#3
Sumit Singh Profile Picture

Sumit Singh 2,819

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans