Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Swathi12
Tera Expert

How to hide/remove "Add" and "Remove All" buttons in multi row variable set

Release worked on : London.

Step 1 : Import attached XML file "sys_ui_script_2f9c4e0edb6f234060339c28db9619bf (1).xml"the jquery library in sys_ui_script table. After importing successfully you will be having a new entry in the sys_ui_script table named "cdsCal_jquery_min_js".

Step 2: Import attached XML file "sp_widget_b43c47c2db35770086bf9ad5db9619d5.xml" consisting of the new widget "Remove Multi Row VS Buttons" created in Service portal "sp_widget" table

In this widget the div wherein add and remove all buttons are there are hidden in client script using jquery.

Step 3: For the jquery to work , we need to add the widget dependency

Click "New" button , Add the details as below, In the JS Includes , click "New" button again and in the "UI script" field select the one in Step 1

find_real_file.png

Once everything is done then the dependencies will look like below:

find_real_file.pngStep 4: Now in the catalog item , where you want to hide the MVRS buttons , create a new variable with type "Macro" , In the type specifications tab add the widget you created above in "Widget" field.

And we are done 🙂 

Note: We could have done this by using some DOM manipulations in client scripts but as from London release this is not allowed , I tried even after providing this client script as exception , but it didnt work for me. The above way worked really well for me .

Hope this will help you.

 

Regards,

Swathi

 

Comments
Heera Mukundan1
Giga Contributor

Hello,

You can write a

  • Create a catalog UI policy for each of the above variable set and set the ‘Applies on requested item’ as true as this has to be applicable only for the requested item. Do not check ‘Applies on a Catalog Item View ’.
  • Create a catalog ui policy action and select the multirow variable set in the ‘Variable Name’ and make read only true.

Thanks,

Heera

asifnoor
Kilo Patron

Hi,

I have written an article on how you can disable the buttons in the MRVS through DOM. It is working fine in Orlando release.

https://community.servicenow.com/community?id=community_article&sys_id=376e4dfadb7698d0fa192183ca961...

Mark the comment as helpful if it helps.

Version history
Last update:
‎06-04-2019 04:04 AM
Updated by: