Field values is not getting updated in the list

suvetha3
Kilo Expert

We have a field called 'Tower' (defined in the Group table) in the Incident form. It populates automatically based upon the assignment group selected. When we open a record, we can see the values in the Tower field but the same is not updated in the list view. We have to run a background script to update the same. We want the field values to get updated in the form as well as in the list. Please assist  on this. 

 

8 REPLIES 8

Hi Harsh,

When i disabled the client script and updated manually it looks fine. The problem is with the client script. 

Please reply with the code to fix the issue. 

Hi Suvetha

Script is ok . You need to do some test on it. Please follow below

 


function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (newValue === '') {
return;
}
var gr = g_form.getReference('assignment_group', callback);
function callback(gr)
{
alert("HcAlert: vendor " + gr.u_vendor+"Tower : "+gr.u_tower); // Check what alert is displaying
//Set the assignment group which has below u_vendor and check if alert is displaying which is inside if
if(gr.u_vendor == "1562a5dcdb1a7600714afb541f96194d") {
alert("HcAlert Found vendor");
//g_form.setDisplay('u_tower',true);// commented for now. you can uncomment based on the result
g_form.setValue('u_tower',gr.u_tower);
}
else{
//g_form.setDisplay('u_tower',false); commented for now. you can uncomment based on the result
}
}
}

Chalan B L
Giga Guru

Adding to harsh comments please do check on ACLs as well

 

Below thread may help please have a look

https://community.servicenow.com/community?id=community_question&sys_id=e3660fe1db1cdbc01dcaf3231f961946

 

Regards,

Chalan

 

Rakhesh
Kilo Guru

Hi,

 

In above screenshot how the Tower field is filled???

 

I mean it was filled by using client scripts it is not applicable in list view.

 

if your requirement is auto population try to use in BR .It is come to list view too.