For some Users, location field is populating as empty on the incident form even location is fill.

Ashwini Sawant2
Tera Contributor

Hello Team,

 

I have received an incident in which, users whos location is filled  in the user table but on the incident form there location is populating as empty. I am unable to reproduce this issue in the NON - PROD. Also, I can see that location  is also active in location table and for the other users it was auto populating. 

 

Can anyone suggest/guide me  what should be root cause and how to resolve this issue ?

 

Below is the On change client script to Set Location to User on incident tabel - 

 

function onChange(control, oldValue, newValue, isLoading) {
   if ((isLoading && !g_form.isNewRecord()) || (g_form.isLiveUpdating && g_form.isLiveUpdating()))
      return;

   if (newValue == '' || newValue == null) {
      g_form.setValue('location', '');
      return;
   }
   if (!g_form.hasField('location'))
      return;
   var caller = g_form.getReference('caller_id', setLocation);
}
function setLocation(caller) {
   if (caller)
       g_form.setValue('location', caller.location);
}

 

Thank you 

1 ACCEPTED SOLUTION

Hi @Ashwini Sawant2 

 

You need to set it mandatory with the help of Catalog UI Policy and educate users to raise incidents from there only to avoid such issues.

 

Please mark my answer helpful and correct.

 

Regards,

Amit

View solution in original post

9 REPLIES 9

Hi @Ashwini Sawant2 

 

I am not much sure but I agree with @Vishwa Pandya19 Using getReference() in client script to auto-populate is not recommended. May be this is why your script is not working efficiently. You need to explore the documentation.

 

Regards,

Amit

Hello @Amit Pandey,

 

I found 1 reason this is because, users are raising incidents from   self service view and in this view's form layout the location & channel field was not added and hence it's location is empty for them.

 

But we also came across another scenario in which user is raising incident from service portal only and she raised 11 incidents on same day out of that 10 have location details filled and only 1 incident is not having location details.

 

Can anyone suggest what was the root cause of the same ?  

Amit Pandey
Kilo Sage

Hi @Ashwini Sawant2 

 

Is location field mandatory on the service portal?

 

Regards,

Amit

No

Hi @Ashwini Sawant2 

 

You need to set it mandatory with the help of Catalog UI Policy and educate users to raise incidents from there only to avoid such issues.

 

Please mark my answer helpful and correct.

 

Regards,

Amit