max_length on a Single Line Text variable

xiaix
Tera Guru

We are on the Kingston instance.

According to this documentation:
https://docs.servicenow.com/bundle/kingston-it-service-management/page/product/service-catalog-manag...

find_real_file.png

Well, I do do this:

find_real_file.png

Then try to save:

find_real_file.png

 

And it disappears!

find_real_file.png

 

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.

2 REPLIES 2

Mark Roethof
Tera Patron
Tera Patron

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?

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Rahul Kumar17
Tera Guru

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;
}
If my response helped please mark it correct and close the thread.

Thanks,
Rahul Kumar