# AppSourceCop Hidden AS0073
Attribute tag must be set.
## Description
Attribute tag must be set.
## Remarks
This rule validates that a tag is specified when using the ../attributes/devenv-obsolete-attribute or ../attributes/devenv-requiredpending-attribute attribute, or when setting the Obsolete State<../properties/devenv-obsoletestate-property> property. The tag provides tracking information such as the timeline of the deprecation or transition.
For Obsolete, the tag appears in the diagnostics AL0432 and AL0433 reported by the AL compiler. For RequiredPending, it appears in the AL0924 warning.
The format of the tag is not validated by the AL compiler. However, you can specify an expected format to be validated by the AppSourceCop. See appsourcecop-as0076.
## Setting up AppSourceCop to validate the Obsolete Tag
The diagnostics for rule AS0073 are hidden by default, so you first have to use a ../devenv-rule-set-syntax-for-code-analysis-tools to surface them.
For example, the following ruleset turns the diagnostic for rule AS0073 into an error.
```json
{
    "name": "My custom ruleset",
    "rules": [
        {
            "id": "AS0073",
            "action": "Error",
            "justification": "Validating that obsolete tags are specified is important"
        }
    ]
}
```
```json
{
    "al.ruleSetPath": "custom.ruleset.json"
}
```
> NOTE
> To fully validate obsolete properties and attributes, it is recommended to enable the rules appsourcecop-as0072, appsourcecop-as0073, appsourcecop-as0074, appsourcecop-as0075, and appsourcecop-as0076.
## 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 Tag<../properties/devenv-obsoletetag-property>.
When the attribute ../attributes/devenv-obsolete-attribute is used, you need to specify the obsolete tag attribute parameter.
When the attribute ../attributes/devenv-requiredpending-attribute is used, you need to specify the Tag parameter.
## Code examples triggering the rule
### Example 1 - Table marked as Obsolete Pending
```al
table 50100 MyTable
{
    ObsoleteState = Pending;
    ObsoleteReason = 'This table has been 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;
}
```
### Example 3 - Default interface method marked as RequiredPending without tag
```al
interface IMyInterface
{
    [RequiredPending('This method will become required.')]
    procedure MyMethod(): Text
    begin
        exit('default');
    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.';
    ObsoleteTag = 'This table is being deprecated with the newest build of the product.';

    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.', 'This table is being deprecated with the newest build of the product.')]
    procedure MyProcedure()
    begin
        // Business logic.
    end;
}
```
### Example 3 - Default interface method marked as RequiredPending with tag
```al
interface IMyInterface
{
    [RequiredPending('This method will become required. Add your implementation now.', '26.0')]
    procedure MyMethod(): Text
    begin
        exit('default');
    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-as0073, 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-as0073/
