- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2017 01:04 AM
When knowledge article attached KB content coping to case worknotes . How can we stop that . We don't need the content .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2017 02:51 AM
Thanks Vinitha ,
Temporary I done the create new field and through UI policy dine it . Still notification is coming . Have to fix .
Once again thanks for you help .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2017 02:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2017 03:00 AM
Hello Vinitha,
Thanks for your quick response . Still the issue is not solved . Changed
the code and tested ( created new script include for that , where this
script include is calling.
cxs_Knowledge
On Mon, Mar 13, 2017 at 3:13 PM, vinitha <community-no-reply@servicenow.com>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2017 03:04 AM
YOU need not create a new one.
You must change the below script include I shared and do not change anything else.
This should work. Why do you create a new one?
Please share your code.
Thanks,
Vinitha.K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2017 03:13 AM
it's read only based on protection policy. Hence created new script
include .
xxxxxx_cxs_knowledge.prototype =
Object.extendsObject(AbstractAjaxProcessor, ,
fields: []
};
if (kbSysId != "") {
var article = new GlideRecord("kb_knowledge");
// if (article.get(kbSysId))
article.addQuery('sys_id',kbSysId);
article.query();
if(article.next())
{
if (!article.canRead())
return new JSON().encode(response);
response.article.id = article.getUniqueValue();
var s = gs.getMessage("Knowledge article") + " " +
article.number + ":\n";
if (gs.getProperty("glide.ui.security.allow_codetag",
"true") != "true")
s += article.short_description;
else {
var displayValue = SNC.GlideHTMLSanitizer.sanitize(new
KnowledgeHelp(article).findDisplayValue());
s += "[code]" + displayValue + "[/code]";
}
if(article.u_publish_to_customer_portal==true){
response.article.content = s;
response.fields = "comments".split(",");
} else {
response.article.content = s;
response.fields = "work_notes".split(",");
}
}
}
return new JSON().encode(response);
},
isKnowledgeSearchAvailable: function() {
var searchField = "" + this.getParameter("sysparm_searchField");
var parts = searchField.split(".");
if (parts.length != 2)
return false;
var grTable = new GlideRecord(parts[0]);
var geTarget = grTable.getElement(parts[1]);
return geTarget.getBooleanAttribute("knowledge_search");
},
type: 'xxxxx_cxs_knowledge'
});
On Mon, Mar 13, 2017 at 3:34 PM, vinitha <community-no-reply@servicenow.com>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2017 03:17 AM
It should not be write protected. DO you have complete Knowledge access?
Here is the code:
var cxs_Knowledge = Class.create();
cxs_Knowledge.prototype = Object.extendsObject(AbstractAjaxProcessor, ,
fields: []
};
if (kbSysId != "") {
var article = new GlideRecord("kb_knowledge");
if (article.get(kbSysId)) {
if (!article.canRead())
return new JSON().encode(response);
response.article.id = article.getUniqueValue();
// var s = gs.getMessage("Knowledge article") + " " + article.number + ":\n";
// if (gs.getProperty("glide.ui.security.allow_codetag", "true") != "true")
// s += article.short_description;
// else {
// var displayValue = SNC.GlideHTMLSanitizer.sanitize(new KnowledgeHelp(article).findDisplayValue());
// s += "[code]" + displayValue + "[/code]";
// }
//added vy Vinitha.K
//11.02.2016
//Return a link to the knowledge article instead of the full article text
var s = "Knowledge article " + article.number + ": " + article.short_description + "\n";
if (gs.getProperty("glide.ui.security.allow_codetag", "true") != "true")
s += gs.getProperty('glide.servlet.uri') + "kb_view.do?sysparm_article=" + article.number;
else {
s = "Knowledge article ";
s += '[code]<a title="tProperty('glide.servlet.uri') + 'nav_to.do?uri=kb_view.do?sysparm_article=' + article.number + '" href="' + gs.getProperty('glide.servlet.uri') + 'nav_to.do?uri=kb_view.do?sysparm_article=' + article.number + '" style="color:blue">' + article.number + '</a>[/code]' + ": " + article.short_description + "\n";
}
response.article.content = s;
response.fields = gs.getProperty("glide.knowman.attach.fields", "").split(",");
}
}
return new JSON().encode(response);
},
isKnowledgeSearchAvailable: function() {
var searchField = "" + this.getParameter("sysparm_searchField");
var parts = searchField.split(".");
if (parts.length != 2)
return false;
var grTable = new GlideRecord(parts[0]);
var geTarget = grTable.getElement(parts[1]);
return geTarget.getBooleanAttribute("knowledge_search");
},
type: "cxs_Knowledge"
});