Business Rule - for enforcing Max Length on a String Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2019 11:07 AM
I need to set a string field to a max length of 13,000 characters. It currently does not enforce this.
I was thinking of doing this in a business rule - does anyone have any scripting/code for this?
I need something like this" You can create a business rule on the table with the field, to run on insert/update. and then truncate that field's value to the desired length. Defined the business rule to run "Before"."
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2019 09:54 AM
I have set the max length to 13,000 but it does NOT enforce anything that exceed 255 characters - it is a bug/feature from ServiceNow and this is what their support recommended.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2019 11:48 AM
Hi Elizabeth,
You could simply right click the field label > Configure Dictionary > set the Max length to 13000. If you need to alert the user of the max length or something like that, then it is a slightly different story. That is when you need to write script and such..
Regards,
Phuong
If you find my suggestions helpful, please mark it as correct or helpful to help out others as well 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2019 09:55 AM
I have set the max length to 13,000 but it does NOT enforce anything that exceed 255 characters - it is a bug/feature from ServiceNow and this is what their support recommended.