/// <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; } } } }
"preprocessorSymbols": ["BC26"]
/// <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; } } } }
CLEAN26
/// <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:
#if not CLEAN26
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.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Rishabh Kanaskar 4,232
Nimsara Jayathilaka. 2,863
Sumit Singh 2,819