{"title":"Interface method lifecycle","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-interface-method-lifecycle/","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-interface-method-lifecycle, 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-interface-method-lifecycle","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 the recommended lifecycle for adding, transitioning, and removing interface methods in AL.","date":"2026-04-29","meta":{"topic":"concept-article"},"outline":[{"level":2,"title":"Method states","slug":"method-states","at":329,"chars":581},{"level":2,"title":"Runtime identifier","slug":"runtime-identifier","at":910,"chars":536},{"level":2,"title":"Adding new methods to a published interface","slug":"adding-new-methods-to-a-published-interface","at":1446,"chars":754},{"level":2,"title":"Transitioning from default to required","slug":"transitioning-from-default-to-required","at":2200,"chars":1458},{"level":3,"title":"Phase 1 - Mark as RequiredPending","slug":"phase-1---mark-as-requiredpending","at":2344,"chars":811},{"level":3,"title":"Phase 2 - Make required","slug":"phase-2---make-required","at":3155,"chars":503},{"level":2,"title":"Removing methods from an interface","slug":"removing-methods-from-an-interface","at":3658,"chars":649},{"level":2,"title":"Summary of AppSourceCop rules","slug":"summary-of-appsourcecop-rules","at":4307,"chars":764},{"level":2,"title":"Code fixes","slug":"code-fixes","at":5071,"chars":511},{"level":2,"title":"Lifecycle diagram","slug":"lifecycle-diagram","at":5582,"chars":1607},{"level":2,"title":"Related information","slug":"related-information","at":7189,"chars":209}],"text":"> APPLIES TO: Business Central 2026 release wave 2 and later.\nWhen you publish an interface in an AL extension, dependent extensions can implement it. Changes to the interface's methods can break those extensions. This article describes the recommended lifecycle for safely adding, transitioning, and removing interface methods.\n## Method states\nAn interface method can be in the following states:\nState|Has body|Description\nRequired|No|All codeunits must implement this method. Contributes to the interface runtime identifier.\nDefault (optional)|Yes|Has a default implementation. Implementors can override it but don't have to. Doesn't affect the runtime identifier.\nRequiredPending|Yes|Marked with `[RequiredPending]`. Still optional, but the compiler warns implementors to add their own implementation.\nObsolete Pending|Either|Marked for future removal.\nObsolete Removed|Either|Removed from the public API.\n## Runtime identifier\nThe interface runtime identifier is a hash computed from the required (non-default) methods. It determines binary compatibility between the interface and its implementors at deployment.\nKey rules:\n Default methods and RequiredPending methods don't contribute to the hash.\n Adding or removing default methods doesn't change the runtime identifier.\n Making a method required or removing a required method changes the runtime identifier.\n When the runtime identifier changes, dependent extensions must be recompiled.\n## Adding new methods to a published interface\nYou can't add a required method to a published interface directly. The AppSourceCop rule analyzers/appsourcecop-as0066 prevents this change because it breaks all existing implementors.\nInstead, add new methods as default methods (with a body). Default methods are safe to add because:\n Existing implementors continue to compile.\n The runtime identifier doesn't change.\n Dependent extensions don't need recompilation.\n```al\ninterface IPaymentProvider\n{\n    // Existing required method\n    procedure ProcessPayment(Amount: Decimal): Boolean;\n\n    // New default method - safe to add\n    procedure ValidatePayment(Amount: Decimal): Boolean\n    begin\n        exit(true); // Default: always valid\n    end;\n}\n```\n## Transitioning from default to required\nWhen a default method must eventually be implemented by all consumers, follow this two-phase process:\n### Phase 1 - Mark as RequiredPending\nAdd the attributes/devenv-requiredpending-attribute to the default method. The method keeps its body, so it stays optional.\n```al\n[RequiredPending('Implement ValidatePayment for proper validation. This will become required in version 3.0.', '2.0')]\nprocedure ValidatePayment(Amount: Decimal): Boolean\nbegin\n    exit(true);\nend;\n```\nThe compiler emits warning AL0924 for any implementing codeunit that doesn't override the method:\n> Interface method 'IPaymentProvider.ValidatePayment' will become required. Reason: Implement ValidatePayment for proper validation. This change will become required in version 3.0. Tag: 2.0. Add an implementation now to avoid a future breaking change.\nA code fix is available to help implementors: Implement RequiredPending interface method.\n### Phase 2 - Make required\nIn a later major version, remove the body and the `[RequiredPending]` attribute:\n```al\nprocedure ValidatePayment(Amount: Decimal): Boolean;\n```\nThe method is now required. Any codeunit that doesn't add its own implementation fails to compile. The AppSourceCop emits analyzers/appsourcecop-as0149 to warn about the runtime identifier change.\n> IMPORTANT\n> Skipping Phase 1 and going directly from default to required triggers analyzers/appsourcecop-as0148, which is an error.\n## Removing methods from an interface\nTo remove a method from a published interface, follow the standard Obsolete lifecycle:\n1. Obsolete Pending: Mark the method with `[Obsolete('Pending', 'Use method Y instead.')]`. Callers receive a warning.\n2. Obsolete Removed: In a later version, change to `[Obsolete('Removed', 'Use method Y instead.')]`. Callers receive an error.\n3. Delete: In a subsequent version, remove the method entirely.\n> NOTE\n> Removing a required method changes the runtime identifier (analyzers/appsourcecop-as0149). Removing a default method doesn't change the runtime identifier but still triggers analyzers/appsourcecop-as0018.\n## Summary of AppSourceCop rules\nThe following AppSourceCop rules enforce the interface method lifecycle:\nRule|What it validates|Severity\nanalyzers/appsourcecop-as0066|New required method on published interface|Error\nanalyzers/appsourcecop-as0148|Default method made required without `[RequiredPending]` first|Error\nanalyzers/appsourcecop-as0149|Runtime identifier changed (required method added or removed)|Warning\nanalyzers/appsourcecop-as0072|Tag version must match configured target|Hidden\nanalyzers/appsourcecop-as0073|Tag must be set|Hidden\nanalyzers/appsourcecop-as0074|Tag must not change unless attribute is newly added|Hidden\nanalyzers/appsourcecop-as0075|Reason must be set|Warning\nanalyzers/appsourcecop-as0076|Tag must match configured pattern|Hidden\n## Code fixes\nThe compiler provides code fixes to help implementers:\nDiagnostic|Code fix|Description\nMissing required methods|Implement required interface methods|Adds stubs for required methods only\nMissing required methods|Implement all interface methods|Adds stubs for required and default methods\nRequiredPending warning (AL0924)|Implement RequiredPending interface method|Adds a stub for the RequiredPending method\nAll code fixes support Fix All scopes (Document, Project, Solution) for batch application.\n## Lifecycle diagram\nThe following diagram shows the complete lifecycle of an interface method:\n```\n                    ┌──────────────────┐\n         ┌────────>│  Default method   │──────────────┐\n         │         │  (optional, body) │              │\n         │         └────────┬─────────┘              │\n         │                  │                         │\n    Add new method    Add [RequiredPending]    Add [Obsolete('Pending')]\n         │                  │                         │\n         │                  v                         v\n         │         ┌──────────────────┐      ┌──────────────────┐\n         │         │ RequiredPending  │      │ Obsolete Pending │\n         │         │  (optional+warn) │      │                  │\n         │         └────────┬─────────┘      └────────┬─────────┘\n         │                  │                         │\n         │           Remove body            [Obsolete('Removed')]\n         │                  │                         │\n         │                  v                         v\n         │         ┌──────────────────┐      ┌──────────────────┐\n         │         │ Required method  │      │ Obsolete Removed │\n         │         │   (no body)      │      │                  │\n         │         └──────────────────┘      └────────┬─────────┘\n         │                                            │\n         │                                      Delete method\n         │                                            │\n         │                                            v\n         └────────────────────────────────── (method removed)\n```\n## Related information\ndevenv-interfaces-in-al\nattributes/devenv-requiredpending-attribute\nattributes/devenv-obsolete-attribute\ndevenv-interfaces-in-al-extend\nObsolete objects and tags<devenv-obsolete-objects>"}