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

Thank you so much Mike for your assistance. It is working as expected.

nikih
Tera Contributor

Hi Mike,
I am not able to see your screenshots, could you please repost the solution for this?

Hitoshi Ozawa
Giga Sage
Giga Sage

Cross-posting on different forum is highly discouraged as well as posting the same answer to these posts.

https://community.servicenow.com/community?id=community_question&sys_id=f1c4794adb5a5cd09e691ea66896...

gnewuser
Tera Contributor

I am trying to do the same thing as the OP where I need to display message that the article is retired (in the kb_view page). However I cannot see the images above in the solution. Can someone who can see the images kindly post those there?