addInfoMessage on Knowledge Article View

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2017 08:27 AM
Hello,
I'd like to add an addInfoMessage / addErrorMessage 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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 03:57 AM
This would be for forms, not for the article view. Thanks though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 07:44 AM
When I was looking to answer your question, I did start with the BR "Add Legacy Information Message".
Since you are interested, here is my full research detail.
addLegacyInformationMessage();
functionaddLegacyInformationMessage() {
varpageName = GlideTransaction.get().getPageName();
varkbKnowledge = new KBKnowledgeBase();
varkbKnowledgeBaseId = current.kb_knowledge_base;
varshowMessage = (pageName != "angular" && kbKnowledge.isKBVersion2(kbKnowledgeBaseId));
if (showMessage)
kbKnowledge.setUniqueLegacyInfoMessage(kbKnowledgeBaseId);
}
I think line 8 add some sort of non configurable info message. So, I searched for the KBKnowledgeBase class definition.
I found that its an empty Script Include that expand another one: KBKnowledgeBaseSNC
KBKnowledgeBaseSNC is 100 lines of code, but no function setUniqueLegacyInfoMessage is defined there.
But this class extends another Script Include: KBCommon, that itself point to KBCommonSNC that is 300 additional line of code.
Inside it also use SNC.knowledgeHelper that I was not able to find.
In KBCommonSNC the message from the Workflow State are defined, but I did not find anything useful to display a new one.
I tried to use a setUniqueInfoMessage function without visible result on the kb_view.dopage (but it display on the form)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2024 09:03 AM
Did you ever get an answer? I need the same thing for a fairly similar reason.