How to update parent record using business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2020 03:46 AM
Hi All,
I have created a after business rule. When change is created need to update the change record in the under parent field in release table.
below is the script.
var gr=new GlideRecord('rm_release');
gr.addQuery('change_request',current.sys_id);
gr.query();
if(gr.next()){
gr.parent=current.sys_id;
gr.update();
}
Thank You,
Sai.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2020 04:42 AM
what is your exact requirement ? do you have change request available on rm_release table record ?
script would be like
var gr=new GlideRecord('rm_release');
gr.addQuery('parent',current.sys_id);
gr.query();
gs.log(' Row count is '+ gr.getRowCount());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2020 04:56 AM
Hi Harsha,
When record is inserted in change table parent should be populated with release record and in release table parent should be populated with change record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2020 05:01 AM
Hi Harsha,
Row count is 0