Why is max_length not working?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
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.
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
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
Regards,
Nikhil Bajaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
@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.