# AppSourceCop Warning AS0075
Attribute reason must be set.
## Description
Attribute reason must be set.
## Remarks
When 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.
## How to fix this diagnostic?
When 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>.
When the attribute ../attributes/devenv-obsolete-attribute is used, you need to specify the obsolete reason attribute parameter.
When the attribute ../attributes/devenv-requiredpending-attribute is used, you need to specify the Reason parameter.
## Code examples triggering the rule
### Example 1 - Table marked as Obsolete Pending
```al
table 50100 MyTable
{
    ObsoleteState = Pending;

    fields
    {
        field(50100; MyField; Integer) { }
    }
}
```
### Example 2 - Procedure marked as Obsolete
```al
codeunit 50100 MyCodeunit
{
    [Obsolete]
    procedure MyProcedure()
    begin
        // Business logic.
    end;
}
```
## Code examples not triggering the rule
### Example 1 - Table marked as Obsolete Pending
```al
table 50100 MyTable
{
    ObsoleteState = Pending;
    ObsoleteReason = 'This table is being deprecated for reason X. Use table Y instead.';

    fields
    {
        field(50100; MyField; Integer) { }
    }
}
```
### Example 2 - Procedure marked as Obsolete
```al
codeunit 50100 MyCodeunit
{
    [Obsolete('This procedure is being deprecated for reason X. Use procedure Y instead.')]
    procedure MyProcedure()
    begin
        // Business logic.
    end;
}
```
## Related information
AppSourceCop Analyzer<appsourcecop>
Get Started with AL<../devenv-get-started>
Developing Extensions<../devenv-dev-overview>

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. https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0075/
