How to restrict or disable the add button in Multi Row Variable Set after the 5th Row?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 10:43 PM
I have to restrict the number of rows to 5 but i am not be able to restrict or disable the add button. Could you please share some thoughts or suggestions ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2019 07:13 AM
Hello Harish,
Its an attribute of MRVS, not a field. You can set it like below.
var var_set_name = g_form.getField("your_varset_name");
var_set_name.max_rows_size=5; //This will allow you to add only 5 rows to MRVS. after that add will be disabled.
Mark the comment as helpful if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2022 03:43 AM
Thanks It worked for me without scripting 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2019 01:30 AM
This code will work
var var_set_name = g_form.getField("your_varset_name");
var_set_name.max_rows_size=5;
It will disable the add button once the rows are 5.
Mark the comment as a correct answer and helpful if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2020 02:39 AM
May I know the client script type you used for above script?
Thanks,
Anji

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2020 02:55 AM
Hi,
The catalog client script UI type has to mobile/service portal.
check here for reference. https://community.servicenow.com/community?id=community_article&sys_id=86971c8bdb4108106064eeb5ca961...
Mark the comment as helpful if it helps.