Hiding "Save as Draft" Button in Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2024 09:29 AM
Hi ServiceNow Community,
I am encountering an issue when trying to hide the "Save as Draft" button in a catalog item on the Service Portal, even after clicking Hide 'Save as draft' it is visible. Despite applying a script to hide the button, it remains visible.
Despite applying a script to hide the button, it remains visible.
Here is the script I used:
function onLoad() {
console.log("onLoad function executed");
hideSaveAsDraftButton();
}
function hideSaveAsDraftButton() {
console.log("hideSaveAsDraftButton function executed");
var saveDraftButton = document.querySelector('button.btn.btn-default.sc-btn.form-control.text-overflow-ellipsis[title="save as draft"]');
if (saveDraftButton) {
console.log("Save as Draft button found, hiding it.");
saveDraftButton.style.display = 'none';
I suspect it might be an issue with a new version of ServiceNow or perhaps I am missing something in my approach. Has anyone else faced this issue or can anyone suggest a solution to hide the "Save as Draft" button effectively?
Thank you for your help!
Regards,
Karolis

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2024 10:00 AM - edited ‎08-03-2024 10:00 AM
Out-of-the-box SP uses a widget instance of "SC Catalog Item".
Out-of-the-box EC uses a widget instance of "HRM Catalog Item".
Is that also your situation?
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2024 10:19 AM
That is correct.
"HRM Catalog Item" This widget is in the Employee Center Core application
and
"SC Catalog Item" is the Service Portal application.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2024 10:28 AM
Yeah but which are you using? Or does this concern both portals?
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2024 10:29 AM
Just one. sc_cat_item

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2024 10:31 AM
Oke thats an odd answer. Did you actually check the widget instance on the portal page concerned? And which widget that is using?
Share a screenshot else please.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field