The CreatorCon Call for Content is officially open! Get started here.

Concurrent record updates

bonsai
Mega Sage

If a record update process and a reference process are performed at the same time, a problem will occur in the state of the record object in the reference process.

 

var gr = new GlideRecord('incident');
gr.query();
if (gr.next()) {

~~Various processing~~

// If another process updates the same record here, the value may have changed.
  gs.info(gr.short_description); // → May be blank
}

 I thought I could use get() to update the state of the record object, but is this an acceptable process?

 

 

var gr = new GlideRecord('incident');
gr.query();
if (gr.next()) {

var tmp_sys_id = gr.sys_id;

~~Various processing~~

gr.get(tmp_sys_id);//Update here

  gs.info(gr.short_description); 
}

 

 

 

 

 

0 REPLIES 0