{"title":"DefaultImplementation Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-defaultimplementation-property/","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/properties/devenv-defaultimplementation-property, 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/properties/devenv-defaultimplementation-property","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":"Specifies the default implementer for the enum value if there is no explicit implementer set for the value.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":168,"chars":25},{"level":2,"title":"Syntax","slug":"syntax","at":193,"chars":82},{"level":2,"title":"Example","slug":"example","at":275,"chars":1512},{"level":2,"title":"Remarks","slug":"remarks","at":1787,"chars":479},{"level":2,"title":"Related information","slug":"related-information","at":2266,"chars":111}],"text":"> Version: _Available or changed with runtime version 5.0._\nSpecifies the default implementer for the enum value if there is no explicit implementer set for the value.\n## Applies to\n Enum Type\n## Syntax\n```al\nDefaultImplementation = Interface = InterfaceImplementation;\n\n```\n## Example\nThe following example illustrates different implementations of the IFoo interface. SomeEnum has DefaultImplementation set to catch the case where some extension uses an enum value that does not implement the IFoo interface.\n```al\npageextension 50130 CustListExt extends \"Customer List\"\n{\n\n    trigger OnOpenPage()\n    var\n        ifoo: Interface IFoo;\n        e: enum SomeEnum;\n    begin\n        e := SomeEnum::Yes;\n        ifoo := e;\n        ifoo.Foo(); // => YesFooImpl specified in Implementation on Yes value\n\n        e := SomeEnum::No;\n        ifoo := e;\n        ifoo.Foo(); // => DefaultFooImpl specified in DefaultImplementation\n\n        e := 2; // No enum value matches this.\n        ifoo := e;\n        ifoo.Foo(); // => UnknownFooImpl specified in UnknownImplementation\n    end;\n}\n\ninterface IFoo\n{\n    procedure Foo()\n}\n\ncodeunit 50145 ErrorFooImpl implements IFoo\n{\n    procedure Foo()\n    begin\n        Message('Bad FOO')\n    end;\n}\n\ncodeunit 50146 DefaultFooImpl implements IFoo\n{\n    procedure Foo()\n    begin\n        Message('Default FOO')\n    end;\n}\n\ncodeunit 50147 YesFooImpl implements IFoo\n{\n    procedure Foo()\n    begin\n        Message('Yes FOO')\n    end;\n}\n\nenum 50135 SomeEnum implements IFoo\n{\n    Extensible = true;\n    UnknownValueImplementation = IFoo = ErrorFooImpl;\n    DefaultImplementation = IFoo = DefaultFooImpl;\n\n    value(0; Yes)\n    {\n        Implementation = IFoo = YesFooImpl;\n    }\n    value(1; No)\n    {\n        // Nothing specified. Using defaults\n    }\n}\n```\n## Remarks\nAdding a new interface to an existing, extensible enum, requires that all extensions of that enum provide an implementations for the interface, which is a breaking change. Providing a default implementation by using the DefaultImplementation property can be used to make such new additions non-breaking.\nRelated to DefaultImplementation is the UnknownValueImplementation property, used for handling unknown enum values. See devenv-unknownvalueimplementation-property.\n## Related information\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}