List field displaying sys_id rather than name after being saved

Sam Ogden
Tera Guru

Hi All,

We have created a list field on our incident table called u_escalated_to.. This is a reference to the sys_user_grmember table and has a simple filter of Group is SM Managers.

When you first select the name in the list it displays correctly.

find_real_file.png

Once you save the record it is displaying as the Sys_ID

find_real_file.png

Any suggestions on how to get it to retain the name rather than the sys_id?

Any help is greatly appreciated

Thanks

1 ACCEPTED SOLUTION

Sorry Sam. Mistake on my part. Go to the script include and change the line:



list.push(grm.getValue('sys_id'));



to



list.push(grm.getValue('user'));



The list was creating a bad list of sys_ids.


View solution in original post

36 REPLIES 36

Check for any errors in System Logs> Errors or warnings in System Logs> Warnings.



If you want to add additional logging, go in to the script and add gs.log() statements such as after line 18 in the script include:



gs.log(grm.getRowCount() + ' members found');



You'll find output from those statements in System Logs> Script Log Statements


HI Chuck,



I've tried adding the log to the code:



find_real_file.png


I've checked the Script log statements but nothing is displaying, not sure if I've added it to the wrong line?


I've checked errors and warnings and not getting anything there.


If you are on Istanbul or later, you could try using the script debugger. Set a breakpoint at line 9 and step through (examining variables, etc.) then see if you can determine where things are going sideways (or if the script include is being called at all.



If you are on Helsinki or earlier, then you'll need to start putting in more gs.log() statements such as at line 9


gs.log('Starting getGrMemberQuery()...');


or after line 9 before 10,


gs.log('memberList=' + memberList.join(','));



Script debugger


hi Chuck,



Thanks for the above, we are on Helsinki at the moment.



I've tried adding in the logs you mentioned but still not seeing anything.   I am going into an incident and then clicking the Escalated to field and clicking the magnifying glass and then seeing the list display.   Would this suggest that the script is never running?



Thanks for all your help


If the log statements are not there, then yes, it suggests the script is not running.



I just noticed that you have the Client Callable checkbox on your script include. That's only really required if you are doing a GlideAjax call. This is not one of those cases. Can you uncheck it, save, and try again?