{"title":"Obsolete attribute","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/attributes/devenv-obsolete-attribute/","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/attributes/devenv-obsolete-attribute, 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/attributes/devenv-obsolete-attribute","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 that the annotated symbol will be deprecated.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":116,"chars":54},{"level":2,"title":"Syntax","slug":"syntax","at":170,"chars":412},{"level":3,"title":"Arguments","slug":"arguments","at":231,"chars":351},{"level":2,"title":"Remarks","slug":"remarks","at":582,"chars":157},{"level":2,"title":"Example","slug":"example","at":739,"chars":303},{"level":2,"title":"Related information","slug":"related-information","at":1042,"chars":350}],"text":"> Version: _Available or changed with runtime version 4.0._\nSpecifies that the annotated symbol will be deprecated.\n## Applies to\n Method\n DeclareMethod\n Variable\n Event\n## Syntax\n```al\n[Obsolete([Reason: Text] [, Tag: Text])]\n```\n### Arguments\n*[Optional] Reason*\nType: ../methods-auto/text/text-data-type\nSpecifies the reason for the symbol being deprecated.\n*[Optional] Tag*\nType: ../methods-auto/text/text-data-type\nSpecifies a free-form text to support tracking of where and when the object was marked as obsolete, for example, branch, build, or date of obsoleting the object.\n## Remarks\nTo mark objects and other elements of code, use the ../properties/devenv-obsoletestate-property and ../properties/devenv-obsoletereason-property.\n## Example\nApply `[Obsolete('<Reason>', '<Tag>')]` to each method or variable that you want to mark as obsolete.\n```al\ncodeunit 50143 SoonObsolete\n{\n    [Obsolete('Pending removal. Use X instead.', '17.0')]\n    procedure MyProcedure()\n    begin\n        // Add the method implementation.\n    end;\n}\n\n```\n## Related information\nAL Method Reference<../methods-auto/library>\ndevenv-method-attributes\n../directives/devenv-directives-in-al\nBest Practices for Deprecation of Code in the Base App<../devenv-deprecation-guidelines>\n../properties/devenv-obsoletestate-property\n../properties/devenv-obsoletereason-property\n../properties/devenv-obsoletetag-property"}