With latest build of AL Extension, it returns following error if any extension fields are over 30 characters:
Length of the table field name must not exceed 30 characters. Longer field names are prone to cause SQL errors. This warning will become an error in a future release.
Can Obsolete property allow us to avoid this error?
Per Microsoft guidance, Obsolete is the way to go for handling destructive changes, but that would mean current field with name >30 characters will remain in the solution, and cause an error when deploying new versions in the future.
Describe the solution you'd like
I'd like to know what is the recommended way to handle such situations. We currently have several tenants who have extension(s) with such problem fields deployed, and need to know that these will not stop working at some point.
One way might be to ignore this error for any field where ObsoleteState=Removed, if this is possible.
Describe alternatives you've considered
I've considered field name change to shorten the fields, but this is disabled for extensions.
Hi @JuricaB,
When you have field names that are longer than 30 characters then because of limitations from SQL server and the way we build up the names means that if a company with a long name might fail to install your extension, therefore we intent to turn this warning into an error at some point and that would mean that your can't publish your extension anymore.
The recommended way forward for you is to create new fields with shorter names, mark the old ones as being obsolete removed, and upgrade your code to use the new fields.
Thanks for the quick reply @thpeder !
If I understood you correctly, you are saying that marking the fields with ObsoleteState=Removed will ensure that this is NOT raised as an error during compile, once warning for too long field names is promoted to errors.
Can you please confirm this understanding?
Hi @thpeder
Can you please confirm my understanding:
Setting ObsoleteState to Removed on otherwise invalid field (where Field Name is too long) will allow compiling and deploying app in the future?
Thanks,
Jurica
Hi @JuricaB,
You have a very good question and I'm not sure what we will end up doing but you have a good point about removing the error if it is marked as ObsileteState=Removed to allow for upgrades.
see #3498
Per comment on DEV yammer cleanup of obsolete fields will be implemented next year:
"we haven't yet implemented the actual removal of the obsoleted fields on the schema level, so upgrading from an app with obsolete fields to an app without them will show an error saying that you cannot delete fields in extensions. We are considering adding the option to clean up the obsolete fields with the next release of BC (April 2020)"