setting value using dotwalking

Community Alums
Not applicable

Hi Team,

 

I have written a before BR script to set boolean value but its not setting it,but on checking the logs , it does show the value is set however when we open the record, we do not see the value.

  var exp = new GlideRecord('sn_ind_tmt_orm_order_line_item');
    exp.addQuery('sys_id', current.order_line_item.toString());
    exp.query();
    if (exp.next()) {
        gs.info('Got the Exp:'+exp.order.u_expedite);
        exp.order.u_expedite = true;
        gs.info('Expedite is:'+exp.order.u_expedite);
      

    }
 
Please let me know what is the issue or what might be the issue of if anything wrong in my way?
9 REPLIES 9

Community Alums
Not applicable

Its still not working

Hi @Community Alums ,

 

Are the logs getting printed?

 

Thanks,

Danish

 

Shubham Singh
Mega Guru

Hi @Community Alums 

 

As you're using dot-walking to set the field value: exp.order.u_expedite

 

GlideRecord will only update the record on the table you are querying for GlideRecord. It will not update the reference field table records. 

 

Run the GlideRecord on the table where the Order field exists and use the update() method if the table where the order field exists and your BR is on a different table.

 

Try to set the value with the quotation as:

exp.order.u_expedite = 'true';

 

Thanks!

 

Mark it as correct and helpful if it works✔️👍

Community Alums
Not applicable

HI All,

 

This is  now resolved after writing the logic in a Flow.

Thanks for your support

@Community Alums 

Mark the answer as correct and helpful whatever worked for you so that others can get help from it.

 

Regards,

Shubham