{"title":"AppSourceCop Error AS0089","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0089/","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-as0089, 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-as0089","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 and which have been published must not be deleted.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0089","slug":"appsourcecop-error-as0089","at":0,"chars":2380},{"level":2,"title":"Description","slug":"description","at":110,"chars":178},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":288,"chars":615},{"level":2,"title":"Code Examples","slug":"code-examples","at":903,"chars":1330},{"level":3,"title":"Example 1: Deleting a Page Customization triggers the rule","slug":"example-1-deleting-a-page-customization-triggers-the-rule","at":920,"chars":375},{"level":3,"title":"Example 2: Renaming an Interface triggers the rule","slug":"example-2-renaming-an-interface-triggers-the-rule","at":1295,"chars":379},{"level":3,"title":"Example 3: Deleting an obsolete pending Page Customization","slug":"example-3-deleting-an-obsolete-pending-page-customization","at":1674,"chars":559},{"level":2,"title":"Related information","slug":"related-information","at":2233,"chars":147}],"text":"# AppSourceCop Error AS0089\nObjects that can be referenced and which have been published must not be deleted.\n## Description\nObjects that can be referenced 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 or renaming the object is required, the recommended approach is to mark it first as ObsoleteState Pending<../properties/devenv-obsoletestate-property>; if you are performing a rename, this is where you would introduce a new object with the new name. You can then mark the old object as ObsoleteState Removed<../properties/devenv-obsoletestate-property> in a later version.\n> NOTE\n> This rule treats renaming and deleting as if it was the same action. The AppSourceCop analyzer cannot track renaming of objects without an ID.\n## Code Examples\n### Example 1: Deleting a Page Customization triggers the rule\nVersion 1.0 of the extension:\n```al\npagecustomization Foo_MyPageCustomization customizes \"Customer List\"\n{\n    layout\n    {\n        modify(Name)\n        {\n            Visible = false;\n        }\n    }\n}\n```\nIn version 2.0 of the extension, Foo_MyPageCustomization has been deleted. This will trigger rule AS0089.\n### Example 2: Renaming an Interface triggers the rule\nVersion 1.0 of the extension:\n```al\ninterface FOO_IExampleInterface\n{\n    procedure ExampleProcedure() : Text\n}\n```\nIn version 2.0 of the extension:\n```al\ninterface FOO_IMyInterface\n{\n    procedure ExampleProcedure() : Text\n}\n```\nThe page customization FOO_IExampleInterface has been renamed, this will trigger rule AS0089.\n### Example 3: Deleting an obsolete pending Page Customization\nVersion 2.0 of the extension:\n```al\ninterface FOO_IMyInterface\n{\n    procedure ExampleProcedure(): Text\n    ObsoleteState = Pending;\n    ObsoleteReason = 'Use FOO_IExampleInterface instead.';\n}\ninterface FOO_IExampleInterface\n{\n    procedure SomeProcedure(): Text\n}\n```\nIn version 3.0 of the extension, FOO_IMyInterface has been deleted. This is okay, because FOO_IMyInterface previously had been marked with `ObsoleteState = Pending` informing developers to use \"FOO_IExampleInterface\" instead.\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}