- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 06:43 AM
I am trying to remove the 'Deploy Catalog Builder Item' option from the choices if the logged in user does not have the catalog_builder_editor role.
Currently this catalog item is nested in an Order Guide. I have tried added Client Scripts to the Catalog Item and the Order Guide with no success.
Below is the script I have put together from looking at other similar postings. Is there something obvious I am doing wrong? Thanks in advanced!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 08:12 AM
Change the UI Type on the client script to all. You have it set to desktop which mean it will only work in the standard UI.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 07:03 AM
Before var userRole add g_form.removeOption(variable name, choice value). You have to hide otherwise it will always be there even if you have script to add it. In the future when you want to provide script please do not include screenshot but use the code sample in the HTML community editor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 07:29 AM
function onLoad() {
g_form.removeOption('what_type_of_catalog_request','deploy_catalog_builder_item');
var userRole = g_user.hasRoleExactly('catalog_builder_editor');
if (userRole == true) {
g_form.addOption('what_type_of_catalog_request','deploy_catalog_builder_item');
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 07:41 AM
Does it work if you access the item itself? Are they using the Service Portal in order to view the order guide?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 08:10 AM
It is not working on the catalog item itself. Yes, we are using Service Portal to access the Order Guide.