{"title":"UnknownValueImplementation Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-unknownvalueimplementation-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-unknownvalueimplementation-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-unknownvalueimplementation-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 implementers used for ordinal values that are not included in the defined list of enum values.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":169,"chars":25},{"level":2,"title":"Syntax","slug":"syntax","at":194,"chars":87},{"level":2,"title":"Example","slug":"example","at":281,"chars":1482},{"level":2,"title":"Remarks","slug":"remarks","at":1763,"chars":908},{"level":2,"title":"Related information","slug":"related-information","at":2671,"chars":149}],"text":"> Version: _Available or changed with runtime version 7.0._\nSpecifies the implementers used for ordinal values that are not included in the defined list of enum values.\n## Applies to\n Enum Type\n## Syntax\n```al\nUnknownValueImplementation = Interface = InterfaceImplementation;\n\n```\n## Example\nThe following example illustrates different implementations of the IFoo interface. SomeEnum has UnknownValueImplementation set to catch the case where some extension uses an unknown enum value.\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\nThe UnknownValueImplementation property applies to enums. Uninstalling enum extensions can result in persisted values becoming unknown. The UnknownValueImplementation provides a generic error handling in such cases. Enums are often used to select an interface implementation. However, due to the nature of an extensible development model, an enum extension and its corresponding interface implementation can be uninstalled from a tenant, while the value for the specific enum is still available, but now pointing to an unknown value. Using the UnknownValueImplementation property when defining an enum prevents throwing a technical error message in the UI and allows for a more user-friendly error handling.\nRelated to UnknownValueImplementation is the DefaultImplementation property, used for fallback to a default value when no enum value is provided. See devenv-defaultimplementation-property.\n## Related information\ndevenv-defaultimplementation-property\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}