logo

NJP

Tips and Tricks : MRVS (Multi Row variable set) : Part 2

Import · Jun 04, 2019 · article

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

image

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

imageStep 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 image

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

View original source

https://www.servicenow.com/community/developer-articles/tips-and-tricks-mrvs-multi-row-variable-set-part-2/ta-p/2322584