# AppSourceCop Error AS0080
Fields must not decrease in length
## Description
Decreasing the length of a field is not allowed. This might break the upgrade of existing installations and dependent extensions.
## Remarks
> IMPORTANT
> If the field is part of the primary key, this is validated by appsourcecop-as0118.
The changes validated by this rule aren't allowed because they are destructive changes for the sync engine.
These changes might also break the runtime of dependent extensions.
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?
Reverting the change will fix this diagnostic. If decreasing the length of the field is required, the recommended approach is to mark the field as Obsolete Pending<../properties/devenv-obsoletestate-property> and introduce a new field with the desired length.
Once all dependent extensions have uptaken the new field, you can mark the original one as Obsolete Removed<../properties/devenv-obsoletestate-property>.
## Code examples triggering the rule
### Example 1 - Decreasing the length of a field
Version 1.0 of the extension:
```al
table 50100 MyTable
{
    fields
    {
        field(50100; MyField; Text[50]) { }
    }
}
```
Version 2.0 of the extension:
```al
table 50100 MyTable
{
    fields
    {
        field(50100; MyField; Text[25]) { }
    }
}
```
In version 2.0, the type of the field MyField has changed from `Text[50]` to `Text[25]`.
As this is a breaking change, if version 1.0 was installed on a tenant, it won't be possible to synchronize and upgrade the version 2.0 of the extension. Moreover, if a dependent extension uses this field, this change of length can lead to runtime exceptions.
## 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-as0080, 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-as0080/
