Strings shortened despite increasing max length of field

stopping
Giga Contributor

I'm running into an odd issue where increasing the maximum length of a string field has no effect on a table. For example, if I create a field which contains a string with a maximum length of 40, and then increase the limit to 100 after the table is created, I can now enter up to 100 characters for that field. However, when I make an update to a record or create a new one, strings are still truncated to 40 characters. I created a brand new table for testing, and I've found that the maximum length change is reflected in the database by looking at the table schema. When making an update using SQL directly, one can have strings which exceed the 40 character limit (such as using gs.sql('UPDATE ...'); ). When inserting or updating using GlideRecord, the strings are still shortened.

 

Any guidance is appreciated.

6 REPLIES 6

stopping
Giga Contributor

An interesting observation: Apparently the updates to the dictionary are occurring too late, I suspect a bad BR of some kind. Here's what happens, in order:



1. Create a table with a string field whose max length is 40. In testing, the max length is 40.


2. Edit the field so its max length is 50. In testing, the max length is 40.


3. Edit the field again so its max length is 60. In testing, the max length is 50.


4. Edit the field again so its max length is 80. In testing, the max length is 60.


5. Edit the field again so its max length is 100. In testing, the max length is 80.



It appears that the updates to the back end are falling behind by one update. I'll try to see if I can find a weird business rule which might be causing this...



Edit: This might be the reason why. There's a business rule on the Dictionary called "Dictionary change length", which contains the following:



system.alterSqlFieldDefintion(current.name, current.element, previous.max_length);



I suppose that the final term should be current.max_length, can someone confirm?



Edit 2: Now when I make that change, it seems as if the maximum length is now getting stuck at 40 altogether. Here's the scenario now:



1. Create a table with a string field whose max length is 20. In testing, the max length is 20.


2. Edit the field so its max length is 30. In testing, the max length is 30.


3. Edit the field again so its max length is 50. In testing, the max length is 40.


4. Edit the field again so its max length is 80. In testing, the max length is 40.


5. Edit the field again so its max length is 100. In testing, the max length is 40.


Did you ever   figure this out?   I'm having the same issue with a field right now - I can't get it to accept anything greater than 40 char.    


I'm stuck with the same issue, did you get it resolved?


I ended up having to request via HI to have this changed on the backend.