{"title":"AppSourceCop Error AS0088","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0088/","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-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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/appsourcecop-as0088","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":"Objects that can be referenced by ID and which have been published must not be deleted.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0088","slug":"appsourcecop-error-as0088","at":0,"chars":1905},{"level":2,"title":"Description","slug":"description","at":121,"chars":184},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":305,"chars":509},{"level":2,"title":"Code Examples","slug":"code-examples","at":814,"chars":944},{"level":3,"title":"Example 1: Deleting a Codeunit triggers the rule","slug":"example-1-deleting-a-codeunit-triggers-the-rule","at":831,"chars":298},{"level":3,"title":"Example 2: Deleting an obsolete pending Codeunit","slug":"example-2-deleting-an-obsolete-pending-codeunit","at":1129,"chars":629},{"level":2,"title":"Related information","slug":"related-information","at":1758,"chars":147}],"text":"# AppSourceCop Error AS0088\nObjects with an ID that can be referenced and which have been published must not be deleted.\n## Description\nObjects 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.\n## How to fix this diagnostic?\nReverting 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>.\nYou 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.\n## Code Examples\n### Example 1: Deleting a Codeunit triggers the rule\nVersion 1.0 of the extension:\n```al\ncodeunit 50120 Foo_MyCodeunit\n{\n    procedure MyProcedure()\n    begin\n        // Business logic.\n    end;\n}\n```\nIn version 2.0 of the extension, codeunit 50120 has been deleted. This will trigger rule AS0088.\n### Example 2: Deleting an obsolete pending Codeunit\nVersion 2.0 of the extension:\n```al\ncodeunit 50120 Foo_MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use 50121 Foo_MyNewCodeunit instead.';\n    procedure MyProcedure()\n    begin\n        // Business logic.\n    end;\n}\n\ncodeunit 50121 Foo_MyNewCodeunit\n{\n    procedure SomeProcedure()\n    begin\n        // Business logic.\n    end;\n}\n```\nIn 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.\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}