
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 04:08 PM
I have a button added to asset forms called "Return Asset", this is done via a UI Action and on click opens a modal window that shows only the fields we want the Service Desk via a view called "returned" to fill in when an asset is returned, however I want it to only have the update button showing.
I've created a client Script to try and achieve this, however all I seem to be able to achieve is showing all buttons or no buttons. Would love some assistance please
Client script:
function onLoad() {
//Remove all buttons except for the 'Update' button
var items = $$('BUTTON').each(function(item) {
if (item.id != 'sysverb_update' && item.id != '') {
item.hide();
}
});
}
This is what actually displays:
When I select "isolate script" it adds (leaves) all buttons:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 04:22 PM - edited 10-13-2022 04:24 PM
You shouldn't use DOM manipulation to accomplish this
In the Condition field for each UI action you want to hide, add this line:
RP.getViewName() != 'returned'
Or at the bottom of each UI Action is a UI Action Visibility related list, where you can add the specific Views that you want each UI Action to be visible on. Depends on whether you want a whitelist or blacklist approach

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 04:22 PM - edited 10-13-2022 04:24 PM
You shouldn't use DOM manipulation to accomplish this
In the Condition field for each UI action you want to hide, add this line:
RP.getViewName() != 'returned'
Or at the bottom of each UI Action is a UI Action Visibility related list, where you can add the specific Views that you want each UI Action to be visible on. Depends on whether you want a whitelist or blacklist approach

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 04:50 PM
Thank you @Luke Van Epen I tested the condition, and it works a treat, I also worked out the UI Action visibility about 2mins before I got your response and proved that also works.
Thanks again for your response, very much appreciated 😁