{"title":"Extend interfaces in AL","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-interfaces-in-al-extend/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-interfaces-in-al-extend, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-interfaces-in-al-extend","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Learn how to extend interfaces in AL to create flexible and adaptable extensions.","date":"2024-09-27","meta":{"topic":"article"},"outline":[{"level":2,"title":"Syntax","slug":"syntax","at":1153,"chars":389},{"level":2,"title":"Extensible interfaces and operators","slug":"extensible-interfaces-and-operators","at":1542,"chars":515},{"level":2,"title":"Related information","slug":"related-information","at":2057,"chars":133}],"text":"> APPLIES TO: Business Central 2024 release wave 2 and later.\nAn interface in AL is a syntactical contract that can be implemented by a nonabstract method. It defines the capabilities an object must have while allowing actual implementations to differ, as long as they comply with the defined interface. See devenv-interfaces-in-al.\nWith Business Central 2024 release wave 2, extensible interfaces in AL are supported. Extending interfaces lets you create flexible and adaptable extensions. You can add new functionality without altering the core system, which can save time and resources and reduce the risk of introducing errors into the existing codebase.\nWhen you declare an interface, you can extend one or more existing interfaces. The new interface inherits all the methods from the interfaces it extends. When you implement an interface that extends other interfaces, the implementing class or object must provide implementations for all the methods defined in the extended interfaces as well as any methods defined in the new interface itself. This ensures that the implementor adheres to the contract specified by all the interfaces involved.\n## Syntax\nIn the example, TheImplementor can be used as both IFoo, IBar, and IFooBar. The syntax for extending an interface is as follows:\n```al\ninterface IFoo\n{\n    procedure Foo();\n}\n\ninterface IBar\n{\n    procedure Bar();\n}\n\ninterface IFooBar extends IFoo, IBar\n{\n    procedure FooBar();\n}\n\ncodeunit 10 TheImplementor implements IFooBar\n{\n    // Must implement IFoo, IBar, IFooBar\n}\n```\n## Extensible interfaces and operators\nExtensible interfaces in AL also support the use of the testing and casting operators is and as. The is operator allows you to check if an object implements a specific interface, while the as operator enables you to cast an object to a specific interface type. This functionality enhances the flexibility and robustness of your code because it allows dynamic type checking and casting. See Type testing and casting operators for interfaces<devenv-interfaces-in-al-operators>.\n## Related information\n devenv-interfaces-in-al\n Type testing and casting operators for interfaces<devenv-interfaces-in-al-operators>"}