{"title":"AppSourceCop Error AS0031","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0031/","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-as0031, 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-as0031","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":"Actions that have been published must not be deleted, because it will break dependent extensions.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0031","slug":"appsourcecop-error-as0031","at":0,"chars":3378},{"level":2,"title":"Description","slug":"description","at":82,"chars":113},{"level":2,"title":"Remarks","slug":"remarks","at":195,"chars":598},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":793,"chars":685},{"level":2,"title":"Examples of errors for dependent extensions","slug":"examples-of-errors-for-dependent-extensions","at":1478,"chars":1753},{"level":3,"title":"Example 1 - Extensions modify this action","slug":"example-1---extensions-modify-this-action","at":1829,"chars":449},{"level":3,"title":"Example 2 - Extensions referencing this action as an anchor for a change","slug":"example-2---extensions-referencing-this-action-as-an-anchor-for-a-change","at":2278,"chars":538},{"level":3,"title":"Example 3 - Extensions moving this action","slug":"example-3---extensions-moving-this-action","at":2816,"chars":415},{"level":2,"title":"Related information","slug":"related-information","at":3231,"chars":147}],"text":"# AppSourceCop Error AS0031\nActions that have been published must not be deleted.\n## Description\nActions that have been published must not be deleted, because it will break dependent extensions.\n## Remarks\nRemoving an action, which has been published isn't allowed because it will break dependent extensions which are referencing or modifying it.\n> NOTE\n> Renaming an action will also trigger this error. AppSourceCop will consider the renamed action as a new action, unrelated to the one defined in the previous version.\n> NOTE\n> From Business Central 2022 release wave 2 (version 21), removing the ../properties/devenv-promoted-property property on an action is also considered a breaking change, since the AL compiler automatically synthesizes an action reference for each promoted action.\n## How to fix this diagnostic?\nIf the action was removed, revert the change by adding back the action and mark it as ../properties/devenv-obsoletestate-property.\nIf the action was renamed to change its display string in the web client, consider using the ../properties/devenv-caption-property property instead.\nIf the action was renamed to comply with naming rules such as appsourcecop-as0011, consider obsoleting the action before introducing a new one in the next version of the app.\nIf the ../properties/devenv-promoted-property property was removed or set to false on an action, consider obsoleting the action before modifying the promoted property in the next version of the app.\n## Examples of errors for dependent extensions\nThe following examples show some of the compilation errors that will be reported on dependent extensions if an action is removed from one version to another.\nVersion 1.0 of the extension defines a page named MyPage that contains an action named MyAction. Version 2.0 does not define this action anymore.\n### Example 1 - Extensions modify this action\nIf a dependent extension modifies this action in a page extension or customization, when compiling against version 2.0, this will lead to a compilation error similar to `The action 'MyAction' is not found in the target 'MyPage' (AL0271)`.\n```al\npageextension 50100 SomePageExtension extends MyPage\n{\n    actions\n    {\n        modify(MyAction)\n        {\n            Visible = true;\n        }\n    }\n}\n```\n### Example 2 - Extensions referencing this action as an anchor for a change\nIf a dependent extension uses this action as an anchor for a change in a page extension or customization, when compiling against version 2.0, this will lead to a compilation error similar to `The action 'MyAction' is not found in the target 'MyPage' (AL0271)`.\n```al\npageextension 50100 SomePageExtension extends MyPage\n{\n    actions\n    {\n        addafter(MyAction)\n        {\n            action(SomeNewAction)\n            {\n            }\n        }\n    }\n}\n```\n### Example 3 - Extensions moving this action\nIf a dependent extension is moving this action in a page extension or customization, when compiling against version 2.0, this will lead to a compilation error similar to `The action 'MyAction' is not found in the target 'MyPage' (AL0271)`.\n```al\npageextension 50100 SomePageExtension extends MyPage\n{\n    actions\n    {\n        movefirst(creation; MyAction)\n    }\n}\n```\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}