Save button is publishing KB article

Mallika Bhupath
Tera Contributor

Hi all,

 

I created a Save button on the KB form. However, whenever I am clicking on Save, it is publishing the article. How can I ensure that this button only saves the KB article and does not Publish it.

 

Thanks,

Mallika

2 REPLIES 2

James Chun
Kilo Patron

Hi @Mallika Bhupath,

 

Can you please share the details of the button?

 

Cheers

ArsalanChaudhry
Tera Guru

Hi @Mallika Bhupath,

 

To create a "Save" button on a Knowledge Base form in ServiceNow that only saves the article without publishing it, you can create a client-side UI Action.

 

In the UI Action, use a script that updates the record without triggering the publish action.

Add this UI Action to the form layout and test the button to ensure it successfully saves the KB article without publishing.

 

UI Action - Example:

var gr = new GlideRecord(current.table);
if (gr.get(current.sys_id)) {
    gr.update();
    gs.addInfoMessage('Article saved successfully.');
} else {
    gs.addErrorMessage('Unable to save the article.');
}

Please mark this as correct answer and helpful if it is resolved, or mark this helpful if this helps you to reach towards solution.

 

Thanks,

Arsalan