{"title":"AppSourceCop Error AS0029","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0029/","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-as0029, 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-as0029","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":"Pages and PageExtensions that have been published must not be deleted.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0029","slug":"appsourcecop-error-as0029","at":0,"chars":3982},{"level":2,"title":"Description","slug":"description","at":136,"chars":86},{"level":2,"title":"Remarks","slug":"remarks","at":222,"chars":566},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":788,"chars":267},{"level":2,"title":"Examples not triggering the rule","slug":"examples-not-triggering-the-rule","at":1055,"chars":1024},{"level":3,"title":"Example 1 - Removing an obsolete page extension","slug":"example-1---removing-an-obsolete-page-extension","at":1091,"chars":559},{"level":3,"title":"Example 2 - Removing a page extension targeting a removed page","slug":"example-2---removing-a-page-extension-targeting-a-removed-page","at":1650,"chars":429},{"level":2,"title":"Examples of errors for dependent extensions","slug":"examples-of-errors-for-dependent-extensions","at":2079,"chars":1756},{"level":3,"title":"Example 1 - Extensions referencing this page using a variable","slug":"example-1---extensions-referencing-this-page-using-a-variable","at":2386,"chars":368},{"level":3,"title":"Example 2 - Extensions running this page from code","slug":"example-2---extensions-running-this-page-from-code","at":2754,"chars":376},{"level":3,"title":"Example 3 - Extensions running this page from an action","slug":"example-3---extensions-running-this-page-from-an-action","at":3130,"chars":322},{"level":3,"title":"Example 4 - Extensions extending or customizing this page","slug":"example-4---extensions-extending-or-customizing-this-page","at":3452,"chars":383},{"level":2,"title":"Related information","slug":"related-information","at":3835,"chars":147}],"text":"# AppSourceCop Error AS0029\nPages and PageExtensions that have been published must not be deleted, since dependent extensions may break\n## Description\nPages and PageExtensions that have been published must not be deleted.\n## Remarks\nIt's not allowed to remove pages which have been published unless they have been marked as ../properties/devenv-obsoletestate-property. This will break dependent extensions which:\n are referencing this page from code,\n are extending the page using a page extension,\n are customizing the page using page customizations.\n> NOTE\n> If a page coming from a dependency has been removed, AppSourceCop allows the removal of page extensions extending it even if these page extensions have not been previously marked as ../properties/devenv-obsoletestate-property.\n## How to fix this diagnostic?\nTo fix this diagnostic, the removal of the page extension must be reverted. The page extension should also be marked as ../properties/devenv-obsoletestate-property instead, so that the page extension can be removed in a future version.\n## Examples not triggering the rule\n### Example 1 - Removing an obsolete page extension\nVersion 1.0 of the extension:\n```al\npageextension 50100 MyCustomerCardExt extends \"Customer Card\"\n{\n    // Some changes on the page.\n}\n```\nVersion 2.0 of the extension:\n```al\npageextension 50100 MyCustomerCardExt extends \"Customer Card\"\n{\n    ObsoleteState = Pending;\n\n    // Some changes on the page.\n}\n```\nOnce dependent extensions have been updated to not reference the page extension anymore, the page extension can be removed.\nVersion 3.0 of the extension:\n```al\n// Page extension has been removed\n```\n### Example 2 - Removing a page extension targeting a removed page\nVersion 1.0 of the extension:\n```al\npageextension 50100 MyCustomerCardExt extends \"Customer Card\"\n{\n    // Some changes on the page.\n}\n```\nLet's consider that between version 1.0, the dependency defining \"Customer Card\" has removed the page. Removing the page extension is then allowed.\nVersion 2.0 of the extension:\n```al\n// Page extension has been removed\n```\n## Examples of errors for dependent extensions\nThe following examples show some of the compilation errors that will be reported on dependent extensions if a page is removed from one version to another.\nVersion 1.0 of the extension defines a page named MyPage. Version 2.0 does not define this page anymore.\n### Example 1 - Extensions referencing this page using a variable\nIf a dependent extension references this page from code, when compiling against version 2.0, this will lead to a compilation error similar to `Page 'MyPage' is missing (AL0185)`.\n```al\ncodeunit 50100 SomeCodeunit\n{\n    procedure SomeProcedure()\n    var\n        p: Page MyPage;\n    begin\n    end;\n}\n```\n### Example 2 - Extensions running this page from code\nIf a dependent extension runs this page from code, when compiling against version 2.0, this will lead to a compilation error similar to `'Page' does not contain a definition for 'MyPage' (AL0132)`.\n```al\ncodeunit 50100 SomeCodeunit\n{\n    procedure SomeProcedure()\n    begin\n        Page.Run(Page::MyPage);\n    end;\n}\n```\n### Example 3 - Extensions running this page from an action\nIf a dependent extension references this page from an action, when compiling against version 2.0, this will lead to a compilation error similar to `Page 'MyPage' is missing (AL0185)`.\n```al\n    action(ActionName)\n    {\n        RunObject = page MyPage;\n    }\n```\n### Example 4 - Extensions extending or customizing this page\nIf a dependent extension extends or customizes this page, when compiling against version 2.0, this will lead to a compilation error similar to `The target Page MyPage for the extension object is not found (AL0247)`.\n```al\npageextension 50100 MyExtension extends MyPage\n{\n    // Some additional changes on the page.\n}\n```\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}