Hiding "Save as Draft" Button in Catalog Item

karolismick
Tera Contributor

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

13 REPLIES 13

karolismick
Tera Contributor

Hey Mark,

I am sending you a screenshot of the widget instance of the portal page. and I wanted to confirm that the portal page in question uses the "sc_cat_item" widget per my understanding. I have attached a screenshot showing the widget details for your review. Also, adding the configuration of catalog item.

If the information is not accurate or if there are other widgets involved, please let me know so we can address the issue correctly.

Unfortunately you are not sharing which widget instance is used.

 

For example:

MarkRoethof_0-1722711471132.png

 

Another example:

MarkRoethof_1-1722711563498.png

 

 

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

karolismick
Tera Contributor

Hey Mark,

Since there was no direct option to hide the "Save as Draft" button for the catalog item, a workaround was found:

We used a personalized list to hide the "Add to Wish List" option. By setting the value of the field hide 'add to wish list' to true, the "Save as Draft" button also becomes hidden.

After implementing this workaround, the catalog item now meets the required criteria.

Thank you!

karolismick_0-1723381109924.png

 

prineshkumar
Tera Expert

To hide the "Save as Draft" button on all catalog items, follow these steps:

1. Go to Service Portal Designer
2. Select pages
3. Navigate to /$spd.do#/sp/editor/sc_cat_item/e2656985ff630200ba13ffffffffff68
4. Check the "Hide Save as Draft button" option

This action should hide the "Save as Draft" button on all catalog items.

 

prineshkumar_0-1736131370731.png