Field data change not allowed
Hello everyone,
in business central, why extending field lenght is considered a destructive change?
Expected behavior In previous nav versions, extending a field and not changing datatype wouldnt be treated as a destructive change.
Versions:
-
AL Language: 3.0.121490
-
Business Central: 13.0.26198.0
-
Runtime 2.1
Hi @frivadulla ! Are you extending the length of a field that is included in a primary key?
Hello, this is an issue for us as well. It is a field in the primary key.
Not being able to do this is an issue since MS has changed field lengths for key fields in base tables. It is not at all ideal to have to create new tables because of these base changes.
@strophanthus can you tell us on which tables we have changed the length of fields used in a key?
@atoader can we increase the field length which is part of Primary key.
The problem is that we want to increase a field lenght that is contained in primery key and this is treated as a destructive change.
Hi @atoader, is this somewhere on the backlog to be resolved soon?
We also run into this error that we cannot increase a primary text field within our own tables, unless you use ForceSync.
Hi @atoader, is this somewhere on the backlog to be resolved soon?
We also run into this error that we cannot increase a primary text field within our own tables, unless you use ForceSync.
This is a obvious Appsource validation bug. Increase primary field lenght and publish in Appsource returns us this merror message:
"Error AS0080: Field 'Item No.' has changed from 'Code[10]' to 'Code[20]' in table or table extension 'TIP SILICIE Item Pack. Type'. Decreasing the length of a field is not allowed. For fields used in the primary key, the field length cannot change.."
The message says "Decreasing" but we are not Decreasing anything, we are increasing the field with the same type. Please, considering the message text this must be clasified as Appsource validation issue, and must be fixed, to allow this kind of changes. I understand decrease field lenght must be considered as destrutive but never increase a field can be considered a validation error , even in a primary key.
Please @atoader , can you answer anything?
Thanks in advance.
We do not have plans on allowing to change the length of text/code field which is part of the primary key of the table. This is currently by-design, but feel free to post this on our Ideas forum at https://aka.ms/BusinessCentralideas, or vote up the idea if its already there. We are constantly monitoring top ideas and will consider them for a future release.
Regarding the AppSourceCop validation, @JalmarazMartn, are you changing the length of a field which is part of the primary key of the extension? If yes, then this is by-design as the AppSourceCop follows the same rules as the sync engine. If your field is not part of the primary key and you are increasing the length of the field, please create a new issue on Github including the AL code to reproduce the issue and we will look into it.
Closing this issue based on the suggestions above.
We do not have plans on allowing to change the length of text/code field which is part of the primary key of the table. This is currently by-design, but feel free to post this on our Ideas forum at https://aka.ms/BusinessCentralideas, or vote up the idea if its already there. We are constantly monitoring top ideas and will consider them for a future release.
Regarding the AppSourceCop validation, @JalmarazMartn, are you changing the length of a field which is part of the primary key of the extension? If yes, then this is by-design as the AppSourceCop follows the same rules as the sync engine. If your field is not part of the primary key and you are increasing the length of the field, please create a new issue on Github including the AL code to reproduce the issue and we will look into it.
Closing this issue based on the suggestions above.
I was changing primary field key. Thank you very much.