{"title":"AppSourceCop Error AS0080","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0080/","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-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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/appsourcecop-as0080","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":"Decreasing the length of a field is not allowed.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0080","slug":"appsourcecop-error-as0080","at":0,"chars":2078},{"level":2,"title":"Description","slug":"description","at":63,"chars":145},{"level":2,"title":"Remarks","slug":"remarks","at":208,"chars":581},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":789,"chars":445},{"level":2,"title":"Code examples triggering the rule","slug":"code-examples-triggering-the-rule","at":1234,"chars":697},{"level":3,"title":"Example 1 - Decreasing the length of a field","slug":"example-1---decreasing-the-length-of-a-field","at":1271,"chars":660},{"level":2,"title":"Related information","slug":"related-information","at":1931,"chars":147}],"text":"# AppSourceCop Error AS0080\nFields must not decrease in length\n## Description\nDecreasing the length of a field is not allowed. This might break the upgrade of existing installations and dependent extensions.\n## Remarks\n> IMPORTANT\n> If the field is part of the primary key, this is validated by appsourcecop-as0118.\nThe changes validated by this rule aren't allowed because they are destructive changes for the sync engine.\nThese changes might also break the runtime of dependent extensions.\nThe validation of the length of table fields was previously done with appsourcecop-as0004 and has now been split into two different rules:\n appsourcecop-as0080 - which validates against decreasing the length of fields\n appsourcecop-as0086 - which validates against increasing the length of fields\n## How to fix this diagnostic?\nReverting 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.\nOnce all dependent extensions have uptaken the new field, you can mark the original one as Obsolete Removed<../properties/devenv-obsoletestate-property>.\n## Code examples triggering the rule\n### Example 1 - Decreasing the length of a field\nVersion 1.0 of the extension:\n```al\ntable 50100 MyTable\n{\n    fields\n    {\n        field(50100; MyField; Text[50]) { }\n    }\n}\n```\nVersion 2.0 of the extension:\n```al\ntable 50100 MyTable\n{\n    fields\n    {\n        field(50100; MyField; Text[25]) { }\n    }\n}\n```\nIn version 2.0, the type of the field MyField has changed from `Text[50]` to `Text[25]`.\nAs 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.\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}