Simple information message to be displayed when article workflow is draft

MohammedYaseen
Tera Expert

Hi All,

 

I want to display an info message to add attachment whenever the knowledge article is in draft stage

Please provide the client script to add workflow as draft

Thanks

2 ACCEPTED SOLUTIONS

Abhijit4
Mega Sage

Hi @MohammedYaseen 

 

You can simple create an on  load client script with below script:

 

 if(g_form.getValue("workflow_state")=="draft"){
	g_form.addInfoMessage("Please add attachment");
   }

Client script configuration:

Abhijit4_0-1747317969696.png

You can also achieve same by using UI policy also.

View solution in original post

5 REPLIES 5

Dr Atul - LNG
Tera Patron

Hi @MohammedYaseen 

You can create an on load script on KB table and add code like

 

g_form.addInfoMessage("This article in in draft state")

 

 

https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/script/general-scripting/referenc...

This is easy way  Create a UI policy

 

State = Draft

 

in Script add 

above code.

Abhijit4
Mega Sage

Hi @MohammedYaseen 

 

You can simple create an on  load client script with below script:

 

 if(g_form.getValue("workflow_state")=="draft"){
	g_form.addInfoMessage("Please add attachment");
   }

Client script configuration:

Abhijit4_0-1747317969696.png

You can also achieve same by using UI policy also.