Change the value displayed in a reference field by a simple reference qualifier

clyon
Tera Guru

I have a reference field on a request form that I have the reference qualifier set up:

find_real_file.png

This returns the sys_id in the reference field

find_real_file.png

How can I change the value displayed to be the user name?

And I don't know why when I select one of the sys_id's above that it populates the field with the 'created date/time'.

Any help is appreciated!! TIA

1 ACCEPTED SOLUTION

I had to make a few modifications and I was able to get this working.   Thanks for your help!   Much appreciated!


In the script include:


function get_projectsponsor_members(){  




  var answer = '';  


var group = 'd4439e614f7cf200f76d27201310c713';       //Project Sponsor group sys id (not on form)


  var group_members = new GlideRecord('sys_user_grmember');  


  group_members.addQuery('group',group);     // ('group',group);


// group_members.addEncodedQuery('group=d4439e614f7cf200f76d27201310c713');


  group_members.query();  


     


  var memberList = [];


  while(group_members.next()){  


    memberList.push(group_members.getValue('user'));  


  }  


  return 'sys_idIN' +memberList.join();                                                                            


}



AND I changed the variable to be a lookup select box field.


find_real_file.png


View solution in original post

15 REPLIES 15

Chuck Tomasi
Tera Patron

Hi Christina,



It appears one of two things has happened. Someone either changed the display value on the sys_user_grmember table, or possibly the sys_user table, or you need to configure that list (right click> Configure> List) to get it to show the columns you wish.



Yes, that was three things and I said two.


Thank for the info.I configured the list and added the User name and user id.


Now when I click on a name, nothing happens. The Business Sponsor drop down should be populated with the user name.


Is there a better way to do what I'm trying to do?


find_real_file.png


When you say "nothing happens" after clicking a name, does the "*" turn gray (indicating there is something in the field)? or does NOTHING truly happen? That can be the difference of saving a value that needs to be made visible or not saving any value.


I click on the name in the list, that window seems to refresh but nothing is populated in the request form 'Business Sponsor' field as it stays blank/empty.