Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 10:01 PM
Hi Everyone
I have Article body field (html type) in Custom table and Same value need to populate Article body field in knowledge table. could you please any one help on this
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 10:23 PM
You can write business rule on custom table.
onAfter/onBefore business rule (depend upon your need)
/* Get custom tables article body */
var body = current.getValue('custom_body_field_name');
/* Glide record on kb_knowledge table*/
var grKb = new GlideRecord('kb_knowledge');
grKb.addQuery('number','KB articleNUmber'); //you can adjust your query how and which KB article you want to update. better to get value from custom table
grKb.query();
if(grKb.next()){
grKb.setValue('text',body);
grKb.update();
}
/* Yo can adjust your code accordingly */
Vishal Birajdar
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 10:23 PM
You can write business rule on custom table.
onAfter/onBefore business rule (depend upon your need)
/* Get custom tables article body */
var body = current.getValue('custom_body_field_name');
/* Glide record on kb_knowledge table*/
var grKb = new GlideRecord('kb_knowledge');
grKb.addQuery('number','KB articleNUmber'); //you can adjust your query how and which KB article you want to update. better to get value from custom table
grKb.query();
if(grKb.next()){
grKb.setValue('text',body);
grKb.update();
}
/* Yo can adjust your code accordingly */
Vishal Birajdar
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates