Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

addInfoMessage on Knowledge Article View

MounikaS
Tera Contributor

Hello,

Does any one help me on adding info message to the articles in the kB view.

 

1 ACCEPTED SOLUTION

Sorry for delayed response but got busy with something else.

1> Change application to Knowledge Management - Service Portal

2 > Open portal page called kb_article_view

3> Clone widget Called "Knowledge Article Content"

4> add below code to cloned widget

if(knowledgeRecord.workflow_state == 'retired'){
		gs.addInfoMessage('Article has been retired');
	}

5> change widget on page from Knowledge Article Content to new cloned widget.

Screenshot that will help;

Result:

View solution in original post

23 REPLIES 23

Mike Patel
Tera Sage

When, Where and what you want to show on infomessage?

Hello,

 I'd like to add an addInfoMessage / Banner message box when viewing a knowledge article - in view mode, not edit mode.

The reason is, that if someone follows a direct link e.g. from an e-mail to a knowledge article that is retired I'd like a box to appear automatically at the top of the page advising this.

 At present, if you link directly to an article, a message box appears at the top saying "Exact search match". However, I'm not sure how this is called. On usual forms I'd use a client script of course, but I'm not sure how to do it from a knowledge article view (via kb_view.do).

 

Thanks

You can go to UI Page (sys_ui_page)

search for name is kb_view

and add your message there

HI,

Could you suggest me  where and how i need to write. I tried but it is not working.

Thanks!