{"title":"AppSourceCop Warning AS0075","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0075/","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-as0075, 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-as0075","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":"Attribute reason must be set.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Warning AS0075","slug":"appsourcecop-warning-as0075","at":0,"chars":2167},{"level":2,"title":"Description","slug":"description","at":60,"chars":45},{"level":2,"title":"Remarks","slug":"remarks","at":105,"chars":437},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":542,"chars":527},{"level":2,"title":"Code examples triggering the rule","slug":"code-examples-triggering-the-rule","at":1069,"chars":390},{"level":3,"title":"Example 1 - Table marked as Obsolete Pending","slug":"example-1---table-marked-as-obsolete-pending","at":1106,"chars":179},{"level":3,"title":"Example 2 - Procedure marked as Obsolete","slug":"example-2---procedure-marked-as-obsolete","at":1285,"chars":174},{"level":2,"title":"Code examples not triggering the rule","slug":"code-examples-not-triggering-the-rule","at":1459,"chars":561},{"level":3,"title":"Example 1 - Table marked as Obsolete Pending","slug":"example-1---table-marked-as-obsolete-pending-1","at":1500,"chars":269},{"level":3,"title":"Example 2 - Procedure marked as Obsolete","slug":"example-2---procedure-marked-as-obsolete-1","at":1769,"chars":251},{"level":2,"title":"Related information","slug":"related-information","at":2020,"chars":147}],"text":"# AppSourceCop Warning AS0075\nAttribute reason must be set.\n## Description\nAttribute reason must be set.\n## Remarks\nWhen an object, element, variable, or procedure is marked with ../attributes/devenv-obsolete-attribute or ../attributes/devenv-requiredpending-attribute, you should also specify a reason. The reason provides valuable information -- such as why the change is happening or a workaround -- to developers who reference the element. For Obsolete, the reason appears in AL0432 and AL0433. For RequiredPending, it appears in AL0924.\n## How to fix this diagnostic?\nWhen the property Obsolete State<../properties/devenv-obsoletestate-property> is used to mark an object as `Obsolete Pending` or `Obsolete Removed`, you need to also specify the property Obsolete Reason<../properties/devenv-obsoletereason-property>.\nWhen the attribute ../attributes/devenv-obsolete-attribute is used, you need to specify the obsolete reason attribute parameter.\nWhen the attribute ../attributes/devenv-requiredpending-attribute is used, you need to specify the Reason parameter.\n## Code examples triggering the rule\n### Example 1 - Table marked as Obsolete Pending\n```al\ntable 50100 MyTable\n{\n    ObsoleteState = Pending;\n\n    fields\n    {\n        field(50100; MyField; Integer) { }\n    }\n}\n```\n### Example 2 - Procedure marked as Obsolete\n```al\ncodeunit 50100 MyCodeunit\n{\n    [Obsolete]\n    procedure MyProcedure()\n    begin\n        // Business logic.\n    end;\n}\n```\n## Code examples not triggering the rule\n### Example 1 - Table marked as Obsolete Pending\n```al\ntable 50100 MyTable\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'This table is being deprecated for reason X. Use table Y instead.';\n\n    fields\n    {\n        field(50100; MyField; Integer) { }\n    }\n}\n```\n### Example 2 - Procedure marked as Obsolete\n```al\ncodeunit 50100 MyCodeunit\n{\n    [Obsolete('This procedure is being deprecated for reason X. Use procedure Y instead.')]\n    procedure MyProcedure()\n    begin\n        // Business logic.\n    end;\n}\n```\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}