Why Asych BR is not updating record when record is inserted or updated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2023 04:21 AM
Hi All,
I wrote aych BR to update field when any insertion or updation happens in record. BR is not updating record. Created fix script as well with same logic and it is working fine. Below is the code, Can someone please let me know where is the problem?
var entryRiskEvent=current.risk_event.sn_risk_advanced_event.number;
arr=[];
arr1=[];
var b=[];
var a=[];
var c=[];
ver lee = new GlideRecord('sn_risk_advanced_event');
lee.addQuery('number',entryRiskEvent );
lee.Query();
while(lee.next())
{
arr1.push(lee.getValue('u_source_name'));
var le= new GlideRecord('sn_risk_advanced_event_impact');
le.addQuery('risk_event',entryRiskEvent);
le.query();
while(le.next())
{
arr.push(le.getValue('u_source_name'));
}
for(var i=0;i<arr1.length();i++)
{
var item=arr1[i];
arr.push(item);
}
var dif= new global.ArrayUtil();
b=dif.diff(arr,arr1);
c=join(', ')
lee.u_all_other_source_s=c.toString();
lee.update
arr=[];
a=[];
b=[];
c=[];
arr1=[];
}
Thanks,
Tara Singh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2023 04:35 AM
Hello @Tarasingh26 ,
I dont see lee.update();//Dont see the quotes.
Could this possibly be the reason?
Kind Regards,
Swarnadeep Nandy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2023 04:39 AM
Hi @Swarnadeep I have updated lee.update(); but not working. Can we use array the way I have used in BR?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2023 04:54 AM - edited 08-13-2023 04:55 AM
Yeah that is fine. Asynch BR runs in the same server, just that is triggered time is different.
I see you are using
arr1.push(lee.getValue('u_source_name'));
But nowhere you have defined "arr1"
Can you check if its a typo or not.