Jelly Scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 06:46 AM
Hi All,
I am trying to add an error message on the top of the Article for the users which has been expired.
I got the UI Page where I need to do the changes but as I am new to Jelly and doesn't have much knowledge on it, Can anyone help me how to put that error message only for expired KB articles.
I have added the error message which has to be displayed but it is displaying for all the KB Articles even for published ones.
Attached is the screenshot for your reference.
Thanks.
Rooma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 03:18 PM
I don't understand why you need jelly for this. You could just use a onLoad client script that adds the error to the top of the page with g_form.addErrorMessage("This article has expired.") based on the state of the record. g_form.getValue("state")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2024 01:32 AM
Hi Jim,
The error message which I want needs to be on the view mode not on the edit view of the Article.
Thanks,
Rooma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 11:57 AM
I understand you want to modify the kb_view UI Page. I would suggest going to the script tag in the html and add logic to check state and then use JQuery ($j) to insert your HTML.
$j("title").html('${knowledgeRecord.kb_knowledge_base.getDisplayValue()}'+ " - " + '${knowledgeRecord.number}');
if ('${knowledgeRecord.workflow_state}' != 'published'){
alert("This article is not publshed!!!");
}