{"title":"AppSourceCop Error AS0067","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0067/","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/analyzers/appsourcecop-as0067, 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/analyzers/appsourcecop-as0067","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":"Adding an interface to an enum that has been published must have a default implementation, because dependent enum extensions don't implement the new interface and may break.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0067","slug":"appsourcecop-error-as0067","at":0,"chars":3062},{"level":2,"title":"Description","slug":"description","at":119,"chars":189},{"level":2,"title":"Remarks","slug":"remarks","at":308,"chars":593},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":901,"chars":160},{"level":2,"title":"Code example triggering the rule","slug":"code-example-triggering-the-rule","at":1061,"chars":1135},{"level":2,"title":"Code example not triggering the rule","slug":"code-example-not-triggering-the-rule","at":2196,"chars":719},{"level":2,"title":"Related information","slug":"related-information","at":2915,"chars":147}],"text":"# AppSourceCop Error AS0067\nAdding an interface to an enum that has been published must have a default implementation.\n## Description\nAdding an interface to an enum that has been published must have a default implementation, because dependent enum extensions don't implement the new interface and may break.\n## Remarks\nWhen an extensible enum implements an interface, the AL compiler validates that all of its enum values implement this interface. This applies to enum values defined in the enum itself and to the enums defined in enum extensions. When an extensible enum that was part of the previous version of this extension implements a new interface, a default interface implementation must be specified using the Default implementation<../properties/devenv-defaultimplementation-property> property because dependent extensions extending this enum won't be implementing the interface explicitly.\n## How to fix this diagnostic?\nAdd the Default implementation<../properties/devenv-defaultimplementation-property> to the enum that implements a new interface.\n## Code example triggering the rule\nIn the following examples, the version 1.0 of the extension defines an extensible enum which doesn't implement any interface.\nVersion 1.0 of the extension:\n```al\nenum 50100 MyEnum\n{\n    Extensible = true;\n\n    value(0; MyValue) { }\n}\n```\nVersion 2.0 of the extension:\n```al\ninterface MyInterface\n{\n    procedure MyProcedure()\n}\n\ncodeunit 50100 MyImplementation implements MyInterface\n{\n    procedure MyProcedure()\n    begin\n    end;\n}\n\nenum 50100 MyEnum implements MyInterface\n{\n    Extensible = true;\n\n    value(0; MyValue)\n    {\n        Implementation = MyInterface = MyImplementation;\n    }\n}\n```\nIn version 2.0, the enum implements an interface. If a dependent extension extends this enum, this will lead to a compilation error similar to `Value 'MyExtValue' does not implement interface 'MyInterface' and there is no default implementation for the mentioned interface. (AL0596)`.\nFor example, the following extension compiles when depending on version 1.0, but fails to compile with version 2.0:\n```al\nenumextension 50100 MyEnumExtension extends MyEnum\n{\n    value(50100; MyExtValue) { }\n}\n```\n## Code example not triggering the rule\nVersion 1.0 of the extension:\n```al\nenum 50100 MyEnum\n{\n    Extensible = true;\n\n    value(0; MyValue) { }\n}\n```\nVersion 2.0 of the extension:\n```al\ninterface MyInterface\n{\n    procedure MyProcedure()\n}\n\ncodeunit 50100 MyImplementation implements MyInterface\n{\n    procedure MyProcedure()\n    begin\n    end;\n}\n\nenum 50100 MyEnum implements MyInterface\n{\n    Extensible = true;\n    DefaultImplementation = MyInterface = MyImplementation;\n\n    value(0; MyValue)\n    {\n        Implementation = MyInterface = MyImplementation;\n    }\n}\n```\nIn version 2.0, the enum specifies a default implementation, which will prevent compilation errors for dependent extensions extending this enum.\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}