- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2018 12:34 PM
Hi All,
I'm using the oob business rule called "Incident Create Knowledge" to bring the "Category" from the Category string field (choice list) of the incident to the kb_category field on the Knowledge Article form which is a reference field.
So on the incident form Category field I have a choice value "hardware"
On the Knowledge Article form in the kb_category reference field I also have a value "hardware"
What is the syntax in the business rule to set category of incident with kb_category of knowledge article?
Ugh.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2018 06:48 AM
hmm, i wonder if there is an issue with setDisplayValue because the field is translated. Not sure on that one, the below method will glide into the table and get the value to set instead:
Function submitDirect() {
var kb = new GlideRecord("kb_knowledge");
var category = current.getValue('category');
var gr = new GlideRecord('kb_category');
gr.addQuery('value', category);
gr.query();
if(gr.next()){
var catSysID = gr.getValue('sys_id');
kb.kb_category = catSysID;
}
kb.source = current.sys_id;
kb.u_authoring_group = current.assignment_group;
kb.author = current.resolved_by;
kb.short_description = current.short_description;
kb.text = current.close_notes;
kb.description = current.description;
kb.insert();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2018 06:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2018 06:17 AM
ok and is the label field in your knowledge categories field marked as the display value for the table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2018 06:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2018 06:48 AM
hmm, i wonder if there is an issue with setDisplayValue because the field is translated. Not sure on that one, the below method will glide into the table and get the value to set instead:
Function submitDirect() {
var kb = new GlideRecord("kb_knowledge");
var category = current.getValue('category');
var gr = new GlideRecord('kb_category');
gr.addQuery('value', category);
gr.query();
if(gr.next()){
var catSysID = gr.getValue('sys_id');
kb.kb_category = catSysID;
}
kb.source = current.sys_id;
kb.u_authoring_group = current.assignment_group;
kb.author = current.resolved_by;
kb.short_description = current.short_description;
kb.text = current.close_notes;
kb.description = current.description;
kb.insert();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2018 07:04 AM
David,
That was it. The solution.
I guess there must have been more to this than you and Lars first thought. For some reason it must be more than a typical string/choice to reference field.
So in your solution. I have to get the sys_id of the category on the kb_knowledge form that I want to enter by matching value on the incident form. Then I enter the sys_id into the kb_category field instead of the value.
Thank you David for taking time out of your day to help me.
I really appreciate this.
I'll try to repay you buy taking 2 hours this weekend to try and answer questions on the community forum. I'm still pretty new but maybe I can help people newer than myself.