Reference field value not visible in form and showing 'No preview available' when clicked on info icon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2021 10:04 PM
Hi,
Assignment group field is updated in background script (PFB) , but value is not displaying in form as well as in list view. But if I tried to update assigned to field using similar script(d.assigned_to='XXXX') it works fine. I can use setDisplayValue() in below script to make it work for group, but I just need to know why assigned to filed got updated correctly and not group field? what is the difference between these fields referencing to user/group table? Note: Even I checked both dictionary override fields, there is no much difference. Also, no field in user/group table is marked as display true and value we are trying to update in group field is available in instance.
Background Script Used:
var d= new GlideRecord('incident');
d.addEncodedQuery('numberSTARTSWITHXXXXXXXXXX');
d.query();
gs.print(d.getRowCount());
if(d.next()){
d.assignment_group='cross platform';
d.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2021 11:24 PM
I tried in below 2 ways to update assigned to field (gr.assigned_to='XXXX') and it worked ,
--> XXXX as 'userID of user record'
--> XXXX as 'name of user record'
Note: I didn't use XXXX as sys_id.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2021 11:28 PM
It works when the reference table is user table.
But not for other tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2021 11:36 PM
yeah exactly this works only for fields referencing to user table.
So, this is OOB feature in service now ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2021 11:40 PM
Yeah, just figured out.
--> XXXX as 'userID of user record' - will work fine as it is always uniques
--> XXXX as 'name of user record' - will work fine only if no duplicate names present in the user table
Regards,
Mahesh Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2021 11:50 PM
Thanks Mahesh for your timely response. Appreciate it!!!! If you come to know more information about 'what is making user reference field to update in this method', Kindly share it here.