- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 07:22 PM
I'm trying to hide the button "Request" with in the catalog item in Service Portal.
While I was able to hide Submit/ Order button, still unable to do the same for Request button.
All I'm trying to achieve, for example :
If checkbox - RAM - 32GB is selected, Hide Request button below.
Any help is deeply appreciated.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2020 09:00 AM
Thank you,
I was able to figure this out with using below UI script to the theme of the service portal within JS include, all I forgot to do is to set the UI type to All.
& call the function hideSubmitButton(); to client script.
//To hide submit button in catalog items.
function hideSubmitButton() {
$('button[name="submit"]').hide();
}
To show if unchecked the checkbox, then below code-
showSubmitButton(); // calling in client script directly
//To hide submit button in catalog items.
function showSubmitButton() {
$('button[name="submit"]').show();
}
Strange, but this works for me now great on both button types Submit & Request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 07:29 PM
Solution 1: You can edit the Catalog item Widget to hide it based on the condition mentioned above.
I would say Since Catlog Item Widget is Common for displayng Catalog item in Service Portal. It will not be a good practice to do so.
Solution 2: Do a OnSubmit Client Script, Erroring out the submission for the above condition. In that way even if that button is visible End User will not be able to submit the request.
Mark Helpful if it helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2020 09:00 AM
Thank you,
I was able to figure this out with using below UI script to the theme of the service portal within JS include, all I forgot to do is to set the UI type to All.
& call the function hideSubmitButton(); to client script.
//To hide submit button in catalog items.
function hideSubmitButton() {
$('button[name="submit"]').hide();
}
To show if unchecked the checkbox, then below code-
showSubmitButton(); // calling in client script directly
//To hide submit button in catalog items.
function showSubmitButton() {
$('button[name="submit"]').show();
}
Strange, but this works for me now great on both button types Submit & Request