How to restrict or disable the add button in Multi Row Variable Set after the 5th Row?

RISHAV SANSON
Tera Contributor

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 ? 

33 REPLIES 33

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.

Thanks It worked for me without scripting 🙂

asifnoor
Kilo Patron

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.

May I know the client script type you used for above script?

 

Thanks,

Anji

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.