Why is max_length not working?

ServiceNow Use6
Tera Guru

Hi,

I have created max_length attibute to Description 5 on incident table, but it is not working. I don't want to use scripting, but why is it not working. Kindly help.

 

1.jpg

 

2.jpg

 

3.jpg

 

4.jpg

 

5.jpg

 

Regards

Suman P.

 

 

6 REPLIES 6

Rafael Batistot
Tera Sage

Hi @ServiceNow Use6 

 

May you try configure the max length in form builder options

Nikhil Bajaj9
Giga Sage

Hi @ServiceNow Use6 ,

 

Please refr this thread:-

https://www.servicenow.com/community/developer-forum/set-max-length-attribute-on-field/m-p/1623777

 

Regards,

Nikhil Bajaj

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

Bhuvan
Kilo Patron

@ServiceNow Use6 

 

Dictionary override does not allow to change the length of child table [incident] and if it needs to be changed, it should be at parent table [task]. Alternate way is to create Client Script, refer below

 

https://www.servicenow.com/community/developer-forum/set-max-length-attribute-on-field/m-p/1623777

 

Thanks,

Bhuvan

Nilesh Pol
Tera Guru

@ServiceNow Use6 This is a common confusion in ServiceNow, and here’s why your approach isn’t working as expected:

 

  • The max_length attribute in the Dictionary Override is not enforced at the client-side/UI level. It’s a back-end constraint, meaning it prevents saving a string longer than the limit only at the database level, not in the form input field.

  • You can still type more than 5 characters into the field in the UI. The enforcement will only happen when the record is submitted — and even then, it might not trigger a clear validation error unless you specifically script it (which you said you want to avoid).

If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful.