Is there a way to avoid the max length check for the table?

Yuki21
Tera Expert

Hello.
An error occurs when changing the maximum length of the table from 1000 to 160.
Is there a way to temporarily disable the check?

Which one should I deactivate?
UI action? business rules?
data policy?

 

aキャプチャ.PNG

キャプチャ.PNG

1 ACCEPTED SOLUTION

Tony Chatfield1
Kilo Patron

Hi, I assume that the field size was increased, and records then populated to the higher limit and now you are rolling back to OOB size?

The system is preventing your change as data will be lost\truncated\corrupted and I think that the correct fix for this would be to review and resolve issues with your data exceeding the field length and then make the size change.

If you don't care about loosing data then you could just set the field content to '' where the string size exceeds 160 char or truncate to 160 char before you run your script.

 

View solution in original post

8 REPLIES 8

Tony Chatfield1
Kilo Patron

Hi, I assume that the field size was increased, and records then populated to the higher limit and now you are rolling back to OOB size?

The system is preventing your change as data will be lost\truncated\corrupted and I think that the correct fix for this would be to review and resolve issues with your data exceeding the field length and then make the size change.

If you don't care about loosing data then you could just set the field content to '' where the string size exceeds 160 char or truncate to 160 char before you run your script.

 

Thank you.


After changing from 160 to 1000, it is no longer possible to return to 1000 to 160.
I'm not sure which record in the task table is the cause (1272 digits), so I want to temporarily uncheck it.

Since it's a test instance, it doesn't matter if the data is lost.

HI 

@Yuki21 
Run this script in the  "scripts - background"  to find out the record.

Don't forget to change the table and field's name to the target one .

 

 

 

var gr = new GlideRecord("incident")
gr.query()
while(gr.next()){
  if(gr.getValue("description") && gr.getValue("description").length > 160 ){
    gs.info(gr.getValue("number"))
   }

}

 

Please mark my answer as correct and helpful based on Impact.

Thank you.

 

After checking the applicable fields, there were no more than 160 records.

Is there an error in the maximum value check in such a case?