AL icon indicating copy to clipboard operation
AL copied to clipboard

AppSourceCop Rule AS0004 prohibits field length increase

Open KoFrank opened this issue 6 years ago • 2 comments

Describe the bug Increasing the length of Code and Text table fields throws error AS0004 claiming it is a type change.

To Reproduce Steps and to reproduce the behavior:

  1. Have an extension with a table containing Code and Text fields of defined lenghts.
  2. Put a compiled version of the extension for the version AppsourceCop check.
  3. Increase the lengths of the fields and save the file.

AL Code to reproduce the issue

Expected behavior An increase in the field length should be accepted, as it was in previous BC versions.

5. Versions:

  • AL Language: 5.0.280447
  • Business Central: Version: W1 16.0 (Platform 16.0.11233.11920 + Application 16.0.11240.11946)

KoFrank avatar Jun 15 '20 10:06 KoFrank

Is it really a bug? Increasing a field length was allowed but according to last discussions on the subject this is a breaking change. The reason is if you create a Code[10] and then expand to Code[20], other extension might want to copy your field to another table and pass it as an argument to a procedure. This change will break the extension.

I cannot say I am happy with that but it is consistent with the non-breaking change philosophy.

nicolassaleron avatar Jul 02 '20 21:07 nicolassaleron

This issue has been fixed in our latest developer preview to allow increasing field length.

qutreson avatar Sep 07 '20 07:09 qutreson