max_length on a Single Line Text variable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2019 04:14 AM
We are on the Kingston instance.
According to this documentation:
https://docs.servicenow.com/bundle/kingston-it-service-management/page/product/service-catalog-manag...
Well, I do do this:
Then try to save:
And it disappears!
What's going on?
Funny thing is if I do this in a background script:
var gr = new GlideRecord('item_option_new');
gr.addQuery('sys_id', '1557ce45db38b300bd4bff9aae9619b1');
gr.query();
if (gr.next()) {
gr.attributes = "max_length=200";
gr.update();
}
It stays.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2019 04:23 AM
Hi there,
Out-of-the-box it should work.
Are there perhaps any onSubmit Client Scripts active which could cause this? Any after Business Rules which could cause this (not logical because background script works you say, though you never know...)? Have you tried debugging the field and see what is mentioned?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2019 04:36 AM
Hi,
u write this code
var routing = g_form.getValue('name of variable');
if (routing.length != 200) {
alert('You must enter 200 characters');
return false;
}
Thanks,
Rahul Kumar