Set Character limit on Multi-line Variables for 4 variables

LearnerSN
Tera Contributor

Set Character limit on Multi-line Variables for 4 variables : We have 4 different variables in a catalog form where we have to set limit for them for eg : Description(400), Name(250), Stock(350), Lines(380) how to achieve this pls let me know with less code and as per the best practise.

 

 

14 REPLIES 14

Ankur Bawiskar
Tera Patron

@LearnerSN 

the only option is to use onChange catalog client script as max_length attribute doesn't work on Multi-line text variable

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

Okm @Ankur Bawiskar  agreed, i tried but my script didnt work for 4 varaibles for single variable its working, i want to achieve in a single catalog client script hows that possible

@LearnerSN 

each variable is different so you will have to write 4 onchange scripts

OR

1 onSubmit script

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

Tanushree Maiti
Tera Patron

Hi @LearnerSN 

 

In ServiceNow, max_length attribute does not work for Multi-line text variable . 

So for your use case, you can use OnChange or OnSubmit Catalog Client Script.