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

Thanks. Still looking for the answer to my first question in the previous comment. Did the asterisk (*) remain red/orange or did it get grayed out (indicating something is in that field)?


'*' stays red meaning Nothing is in the field





--this is after selecting a record.




Thanks.



Can you share with me the definition of that business sponsor field? Type, reference, reference qualifier, etc. Screenshots are good.


Thanks for your help.



Business Sponsor field







Hi Christina,



Am I seeing two different Type Specification screenshots for the same variable? One has a simple reference qualifier to get the group members of a specific group, the other uses an advanced reference qualifier.



While I didn't look at the script include in great detail, I noticed your advanced reference qualfier is calling javascript:get_group_members(), but your script include function is called get_projectsponsor_members().