disable only add function in multi row variable set

Bala19
Tera Contributor

Hello All,

is there anyway to hide/disable the Add button in multi-row variable set without restricting the number of rows?

Thanks

Bala

6 REPLIES 6

Anil Shewale
Mega Guru

Hi Bala

 

Try to create the UI Policy on the Catalog Item record, not on the Variable Set record. If you try to create the UI Policy on Variable set, the catalog ui policy actions would show you the available variables; but if you create it on the Catalog Item record you should be able to see the variable set name in the option.

 

refer the following thread it similar to your question it help you.

https://community.servicenow.com/community?id=community_question&sys_id=9551f28cdb3abf40feb1a851ca96...

https://community.servicenow.com/community?id=community_question&sys_id=2a151ed0db262b4011762183ca96...

If it help mark helpful or correct 

Thanks and regards

Anil

Gaurav Shirsat
Mega Sage

Hi Bala

First Thing you have to achieve this by using Catalog UI Policy.

Catalog UI Policy are different than the UI Policy.

The below link will guide you for the Script

https://community.servicenow.com/community?id=community_question&sys_id=2a151ed0db262b4011762183ca96...

https://community.servicenow.com/community?id=community_question&sys_id=478d90bb1bf48c10a59033f2cd4b...

https://community.servicenow.com/community?id=community_question&sys_id=9551f28cdb3abf40feb1a851ca96...

 

The Below link is Service Now Docs  for the Same:-

https://docs.servicenow.com/bundle/newyork-it-service-management/page/product/service-catalog-manage...

Please Mark Correct and Helpful

Thanks and Regards

Gaurav Shirsat

Bala19
Tera Contributor

thanks for the response.I have gone through this earlier itself. but that doesn't help since i just have a requirement disable only Add. I still need remove all , edit and remove.

Note: This is scoped application

thanks

Bala

To disable only add, you can use max_rows_size property of multirow variable set. Here is how you can do this.

//Add these lines in your onload catalog client script
var my_var = g_form.getField("my_var_set");//use your variable set name here
//The number below indicates after how many rows, the add button to disaable. 
//If you want to limit to 5 rows then mention 5 below. 
//If you put 0, it will disable Add button without checking the rows.
my_var.max_rows_size = 5;

Mark the comment as a correct answer and also helpful if it helps.