How to hide/remove submit button for a specific record producer in Service Portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 03:03 AM
We have 3 record producers [on incident table] whose purpose is to show kb articles to users using contextual search feature.
But, somehow users are ordering that item from service portal using 'Submit' button which they are able to see.
We want to hide/remove the submit button for these 3 producers. Kindly help me on the same if anyone has a solution for this 🙂
Thanks,
Ritik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 03:07 AM
Hello,
Can you follow the below community solution to achieve your requirement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 03:09 AM
Hi @nirwan_ritik ,
You can try this using DOM manipulation.
- Create an onChange catalog client script
- Set UI Type to All or Service Portal
- Make sure Isolate script is set to false/unchecked. This field is not on the Catalog client script by default, so you have to add this, either to the form or the list.
- Then in the script use:
function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } if(newValue == 'value you want to hide the submit button for'){ document.getElementById("submit_button").style.display = 'none'; } else{ document.getElementById("submit_button").style.display = ''; } }
Or:
function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } if(newValue == 'value you want to hide the submit button for'){ this.document.getElementById("submit_button").style.display = 'none'; } else{ this.document.getElementById("submit_button").style.display = ''; } }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 07:20 AM
Hi,
I created an onLoad client script for this, but it' s not working. I don't want to validate any values, it's just for that particular record producer, the submit button shouldn't be there.
Regards,
Ritik