# AppSourceCop Error AS0032
Controls that have been published must not be deleted.
## Description
Controls that have been published must not be deleted, because it will break dependent extensions.
## Remarks
Removing a control which has been published is not allowed because it will break dependent extensions which are referencing or modifying it.
> NOTE
> Renaming a control will also trigger this error. AppSourceCop will consider the renamed control as a new control, unrelated to the one defined in the previous version.
## How to fix this diagnostic?
If the control was removed, revert the change by adding back the control and mark it as ../properties/devenv-obsoletestate-property.
If the control was renamed to change its display string in the web client, consider using the ../properties/devenv-caption-property property instead.
If the control was renamed to comply with naming rules such as appsourcecop-as0011, consider obsoleting the control and introducing a new one.
## Examples of errors for dependent extensions
The following examples show some of the compilation errors that will be reported on dependent extensions if a control is removed from one version to another.
Version 1.0 of the extension defines a page named MyPage that contains a control named MyControl. Version 2.0 does not define this control anymore.
### Example 1 - Extensions modify this control
If a dependent extension modifies this control in a page extension or customization, when compiling against version 2.0, this will lead to a compilation error similar to `The control 'MyControl' is not found in the target 'MyPage' (AL0270)`.
```al
pageextension 50100 SomePageExtension extends MyPage
{
    layout
    {
        modify(MyControl)
        {
            Visible = true;
        }
    }
}
```
### Example 2 - Extensions referencing this control as an anchor for a change
If a dependent extension uses this control 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 control 'MyControl' is not found in the target 'MyPage' (AL0270)`.
```al
pageextension 50100 SomePageExtension extends MyPage
{
    layout
    {
        addafter(MyControl)
        {
            field(SomeNewControl; 15)
            {
            }
        }
    }
}
```
### Example 3 - Extensions moving this control
If a dependent extension is moving this control in a page extension or customization, when compiling against version 2.0, this will lead to a compilation error similar to `The control 'MyControl' is not found in the target 'MyPage' (AL0270)`.
```al
pageextension 50100 SomePageExtension extends MyPage
{
    layout
    {
        movefirst(content; MyControl)
    }
}
```
## Related information
AppSourceCop Analyzer<appsourcecop>
Get Started with AL<../devenv-get-started>
Developing Extensions<../devenv-dev-overview>

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-as0032, 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. https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0032/
