- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2014 12:39 PM
Hey All,
I'm looking to modify the KnowledgeFunctions UI script to help set a couple of hidden reportable fields on INC/Catalog Tasks for our Knowledge team based on what type of article it is. Caveat is we have some customizations on this script already which you'll see below.
I want to when an article is flagged as an "Internal" or when it's what we call a "Routing" document (both flags on the Knowledge article), that I set hidden fields on the task.
I assume it has to happen in the code here where I started to try just doing a g_form set value, but I'm sure I'm missing lots. Anyone doing anything similar?
//Below is where KB article text is copied to a ticket field.
//RedHat wants this copy to occur only if the article is not internal
if (internal != 'true'){
if (target) {
var ed = self.opener.g_form.getGlideUIElement(targetName);
if (ed && ed.type == 'reference') {
self.opener.g_form.setValue(targetName, sourceID);
} else {
var newValue = "";
if (target.value == "")
newValue = value;
else
newValue = target.value + "\n" + value;
self.opener.g_form.setValue(targetName, newValue);
}
}
}
if (internal == 'true'){
self.opener.g_form.setValue(current.u_internal_kb_attached, 'true');
/* targetName = 'work_notes';
target = self.opener.document.getElementById(tableName + "." + targetName);
if (target) {
var ed = self.opener.g_form.getGlideUIElement(targetName);
if (ed && ed.type == 'reference') {
self.opener.g_form.setValue(targetName, sourceID);
} else {
var newValue = "";
if (target.value == "")
newValue = value;
else
newValue = target.value + "\n" + value;
self.opener.g_form.setValue(targetName, newValue);
}
}*/
}
self.close();
}
Thanks!
Cal
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2014 04:57 AM
FYI if anyone runs across this, I was able to do this with some changes to the code above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2014 04:57 AM
FYI if anyone runs across this, I was able to do this with some changes to the code above.