{"title":"Compiler Warning (future error) AL0920","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/diagnostics/diagnostic-al920/","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/diagnostics/diagnostic-al920, 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/diagnostics/diagnostic-al920","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":"The method '{0}' cannot be used as the implementation for the interface method '{1}' because it is not public.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Compiler Warning (future error) AL0920","slug":"compiler-warning-future-error-al0920","at":0,"chars":2228},{"level":2,"title":"Description","slug":"description","at":601,"chars":193},{"level":2,"title":"Remarks","slug":"remarks","at":794,"chars":483},{"level":2,"title":"How to fix it","slug":"how-to-fix-it","at":1277,"chars":130},{"level":2,"title":"Example of code that triggers AL0920","slug":"example-of-code-that-triggers-al0920","at":1407,"chars":373},{"level":2,"title":"Example of how to fix it","slug":"example-of-how-to-fix-it","at":1780,"chars":266},{"level":2,"title":"Related information","slug":"related-information","at":2046,"chars":182}],"text":"# Compiler Warning (future error) AL0920\n> NOTE\n> The AL diagnostics topics are in preview. If you have input for this topic, we'd love to hear from you. Use our GitHub repo to create a PR and add content to this topic by going to https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb. To read about contributing, see Contribute to the Help<../../help/contributor-guide#contributing>. Thanks!\nThe method '{0}' cannot be used as the implementation for the interface method '{1}' because it is not public.\n> IMPORTANT\n> This warning will become an error with Business Central 2027 release wave 1.\n## Description\nInterface implementations must be publicly accessible because interfaces can be invoked across module boundaries. Non-public methods will not be dispatched correctly at runtime.\n## Remarks\nThis diagnostic is currently a warning but will become an error in a future version (runtime 17.0 / Spring 2027). Interface methods are called through an interface variable, which can be passed across module boundaries. If the implementing method is local or internal, the runtime cannot always dispatch the call correctly.\n> IMPORTANT\n> This warning will become error AL0921<diagnostic-al921> in a future runtime version. Update your code now to avoid a breaking change.\n## How to fix it\nChange the accessibility of the implementing method to public by removing the local or internal access modifier.\n## Example of code that triggers AL0920\n```al\ninterface IMyInterface\n{\n    procedure Calculate(): Integer;\n}\n\ncodeunit 50100 MyCodeunit implements IMyInterface\n{\n    // This triggers AL0920 because the method is local,\n    // but it implements an interface method that must be public.\n    internal procedure Calculate(): Integer;\n    begin\n        exit(42);\n    end;\n}\n```\n## Example of how to fix it\nMake the implementing method public.\n```al\ninterface IMyInterface\n{\n    procedure Calculate(): Integer;\n}\n\ncodeunit 50100 MyCodeunit implements IMyInterface\n{\n    procedure Calculate(): Integer;\n    begin\n        exit(42);\n    end;\n}\n```\n## Related information\nGetting started with AL<../devenv-get-started>\nDeveloping extensions<../devenv-dev-overview>\n../devenv-interfaces-in-al\nCompiler Error AL0921<diagnostic-al921>"}