# AppSourceCop Error AS0088
Objects with an ID that can be referenced and which have been published must not be deleted.
## Description
Objects that can be referenced by ID and which have been published must not be deleted. This might break the upgrade of existing installations and dependent extensions.
## How to fix this diagnostic?
Reverting the change will fix this diagnostic. If deleting the object is required, the recommended approach is to mark it first as ObsoleteState Pending<../properties/devenv-obsoletestate-property>.
You can then remove the object in a later version, or mark it as ObsoleteState Removed<../properties/devenv-obsoletestate-property> if the object is a table. You cannot mark a table `ObsoleteState = Removed` if the table is not `ObsoleteState = Pending` in the previous version.
## Code Examples
### Example 1: Deleting a Codeunit triggers the rule
Version 1.0 of the extension:
```al
codeunit 50120 Foo_MyCodeunit
{
    procedure MyProcedure()
    begin
        // Business logic.
    end;
}
```
In version 2.0 of the extension, codeunit 50120 has been deleted. This will trigger rule AS0088.
### Example 2: Deleting an obsolete pending Codeunit
Version 2.0 of the extension:
```al
codeunit 50120 Foo_MyCodeunit
{
    ObsoleteState = Pending;
    ObsoleteReason = 'Use 50121 Foo_MyNewCodeunit instead.';
    procedure MyProcedure()
    begin
        // Business logic.
    end;
}

codeunit 50121 Foo_MyNewCodeunit
{
    procedure SomeProcedure()
    begin
        // Business logic.
    end;
}
```
In version 3.0 of the extension, codeunit 50120 has been deleted. This is okay, because codeunit 50120 previously had been marked with `ObsoleteState = Pending` informing developers to use "50121 Foo_MyNewCodeunit" instead.
## 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-as0088, 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-as0088/
