- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 06:29 AM
Hi
We have a requirement to hide the Edit article option on the portal for specific knowledge base.
Also want to add a new option to action drop down list.
How can I achieve this?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 07:01 PM
Hi @v-paulp to do this you need to clone Knowledge Article content widget.
In Server side script look for below line which should give you knowledge base name
and in HTML add this to the condition which shows edit article button yellow color highlighted below. this should work.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 04:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 07:01 PM
Hi @v-paulp to do this you need to clone Knowledge Article content widget.
In Server side script look for below line which should give you knowledge base name
and in HTML add this to the condition which shows edit article button yellow color highlighted below. this should work.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 10:39 PM - edited 05-18-2024 10:09 PM
Hi @Harish KM
Thanks it's working.
Can you please help me with the second requirement , we want add a another option named " Review update date" under action button drop down list same as flag and edit article option and when anyone click that option the review date of the kb article will automatically update to 12 month later.
I have added below script in the widget,
HTML CODE
<li class="kb-menu-entry"><a ng-click="c.Review(data.article_sys_id)">{{data.messages.REVIEW}}</a></li>
Client script
c.Review = function(des){
alert(des);
c.data.reviewtime=des;
c.server.update().then(function(){
c.data.reviewtime="";
})
}//update the review date
Server Script
if(input && input.reviewtime){
var grupdate = new GlideRecord('kb_knowledge');
if(grupdate.get(input.reviewtime)){
var actualreviewdate = grupdate.u_review_date;
var gdt = new GlideDateTime(actualreviewdate);
gdt.addMonths(12);
grupdate.u_review_date=gdt;
grupdate.update();
}
}
The button is showing but when I click the button it is not updating the review date the kb article.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2024 06:37 PM - edited 05-19-2024 06:38 PM
Hi @v-paulp modified your client and server a bit, can try below
HTML CODE
<li class="kb-menu-entry"><a ng-click="c.Review(data.article_sys_id)">{{data.messages.REVIEW}}</a></li>
Client script
c.Review = function(des){
alert(des);
c.data.action = "getDate";
c.data.reviewtime=des;
alert("test Before " + c.data.reviewtime);
c.server.update().then(function(response){
alert("test After " + response.u_review_date);//check this alert
})
}//update the review date
Server Script
if (input){
if (input.action == "getDate"){
var grupdate = new GlideRecord('kb_knowledge');
if(grupdate.get(input.reviewtime)){
var actualreviewdate = grupdate.u_review_date;
var gdt = new GlideDateTime(actualreviewdate);
gdt.addMonths(12);
grupdate.u_review_date=gdt;
grupdate.update();
}
}
}
another way to do is refer below
Harish