Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How to update parent record using business rule

Sai25
Tera Guru

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();
}

find_real_file.png

Thank You,

Sai.

 

12 REPLIES 12

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());

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.

Hi Harsha,

 

Row count is 0