Dot walk field

brendanwilson84
Kilo Guru

Hi guys

I have a reference table were I am for walking other field within the table.

I have one field called confidential were if checked won't send emails and acl around it.

A requirement is to have this field be editable which is fine,kind of override it

However,   if I have it listed as confidential true in reference table,   then change it to false on main form, it updates to false in reference table, can I be able to change true false while the actual reference table stays as oringal?  

1 ACCEPTED SOLUTION

Just in case that is what you need, below is a client script to help you:


Type: onChange


field name: your event type field


Script:


function onChange(control, oldValue, newValue, isLoading, isTemplate) {


  if (isLoading || newValue === '') {


          return;


  }



  //Type appropriate comment here, and begin script below


  if(newValue == 'eventValue') { //change this to reflect your event value


  var i = g_form.getValue('parent'); //change this to reflect your parent reference field name, which holds the sys_id to the parent record


  var rec = new GlideRecord('parent_table');//change this to reflect your parent table


  if(rec.get(i)) {


  g_form.setValue('u_confidential', rec.u_confidential); //change the first u_confidential to the name of the field on your form and the rec.u_confidential to the other field, from which you want to take the true/false value.


  }


  }


}



harel


Please mark as correct or helpful based on impact


View solution in original post

8 REPLIES 8

Thanks Harel



That worked to an extent. It works after I update the form. I need this to update automatically.


find_real_file.png


When I select the event type on the form, I would like the new confidential to update to the same as reference field in real time, is that possible with a business rule?


Hi Brendan,


It is possible to do with an onChange client script. Before providing one, I need to know: do you mean that if you select a specific event type, you want to check whether the parent is checked or not and either check it or not according to the parent?



harel


Just in case that is what you need, below is a client script to help you:


Type: onChange


field name: your event type field


Script:


function onChange(control, oldValue, newValue, isLoading, isTemplate) {


  if (isLoading || newValue === '') {


          return;


  }



  //Type appropriate comment here, and begin script below


  if(newValue == 'eventValue') { //change this to reflect your event value


  var i = g_form.getValue('parent'); //change this to reflect your parent reference field name, which holds the sys_id to the parent record


  var rec = new GlideRecord('parent_table');//change this to reflect your parent table


  if(rec.get(i)) {


  g_form.setValue('u_confidential', rec.u_confidential); //change the first u_confidential to the name of the field on your form and the rec.u_confidential to the other field, from which you want to take the true/false value.


  }


  }


}



harel


Please mark as correct or helpful based on impact


thanks harel,



Really appreciate   you taking the time