title | description | ms.author | ms.date | ms.topic | author | ms.reviewer |
---|---|---|---|---|---|---|
AppSourceCop Error AS0031 |
Actions that have been published must not be deleted, because it will break dependent extensions. |
solsen |
05/14/2024 |
reference |
SusanneWindfeldPedersen |
solsen |
Actions that have been published must not be deleted.
Actions that have been published must not be deleted, because it will break dependent extensions.
Removing an action which has been published is not allowed because it will break dependent extensions which are referencing or modifying it.
Note
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.
Note
From Business Central 2022 release wave 2 (version 21), removing the Promoted property on an action is also considered a breaking change, since the AL compiler automatically synthesizes an action reference for each promoted action.
If the action was removed, revert the change by adding back the action and mark it as Obsolete.
If the action was renamed in order to change its display string in the web client, consider using the Caption property instead.
If the action was renamed in order to comply with naming rules such as AS0011, consider obsoleting the action before introducing a new one in the next version of the app.
If the Promoted 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.
The 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.
Version 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.
If 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)
.
pageextension 50100 SomePageExtension extends MyPage
{
actions
{
modify(MyAction)
{
Visible = true;
}
}
}
If 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)
.
pageextension 50100 SomePageExtension extends MyPage
{
actions
{
addafter(MyAction)
{
action(SomeNewAction)
{
}
}
}
}
If 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)
.
pageextension 50100 SomePageExtension extends MyPage
{
actions
{
movefirst(creation; MyAction)
}
}
AppSourceCop Analyzer
Get Started with AL
Developing Extensions