# AppSourceCop Error AS0004
Fields must not change type, since dependent extensions may break
## Description
Fields must not change type.
> NOTE
> This rule validates all fields independently of their Accessibility or ObsoleteState, because they are used when synchronizing the schema defined in the extension to the database.
## Remarks
The validation of the length of table fields was previously done with appsourcecop-as0004 and has now been split into two different rules:
 appsourcecop-as0080 - which validates against decreasing the length of fields
 appsourcecop-as0086 - which validates against increasing the length of fields
## How to fix this diagnostic?
To fix this diagnostic, you must obsolete the field by mark the field as Obsolete Pending<../properties/devenv-obsoletestate-property> and then introduce a new field.
## Example
Version 1.0 of the app:
```al
table 50 MyTable
{
    fields
    {
        field(1; Identifier; Integer) { }
    }
}
```
Version 2.0 of the app:
```al
table 50 MyTable
{
    fields
    {
        field(1; Identifier; Text[30]) { }
    }
}
```
The data type of the field Identifier was changed from Integer to `Text[30]`, which isn't allowed and will trigger this rule.
## 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-as0004, 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-as0004/
