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
its related list, and parent column which hold the change request value on rm_release table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2020 04:47 AM
Hi Harsha,
Yes its related list.
Thank You.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2020 04:56 AM
the script which you have written that will work once you will have change request available on rm_release "parent" column
if i see your screenshot , there is not release attached to it, so the glide record query which you have written wont work. you must have release attached to change request then your query will get some row count and then you will able to update some column .
i am not sure what is your business need, just assuming, you want to add release record whenever you create change request ,
then use below code in your business rule. this way whenever you will create change , new release record will get created and attached to your change request related list.
var gr=new GlideRecord('rm_release');
gr.initialize();
gr.parent = current.sys_id;
gr.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2020 05:01 AM
Hi Harsha,
When we create change record through ui action (this is record producer).
On release form when we will click on ui action of (record producer) once we submitted it. it will create record change table in release table the parent field should be populated with created change record.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2020 05:10 AM
here you have to add one variable as "parent" which will be reference variable, once you will click on ui action you have to pass the "release record " sysid on your record producer variable ( auto fill) , refer the below blog, you will use this code in client side script of your ui action, , this way you can fulfill your requirement.