Reference Qualifier based on the other field value

msm4
Mega Guru

Hi Team,

How to limit the values for a reference field based on the other field value.

Is that possible?

Can anyone suggest some solution please.

BR,

Smitha

15 REPLIES 15

Geoffrey2
ServiceNow Employee
ServiceNow Employee

You need to use the "javascript:" prefix and return an encoded query as a String.


For example, if you have a Company field, then an Employee field, but you only want to let the User select people that are employees of the selected Company, then you would set the following as the Reference qualifier on the Employee field:



javascript: 'company=' + current.company;



That is, we want to look up Users where the company field (on the sys_user table) is equivalent to the company field on the current record.


Hi Geoffrey I know this was 5 years ago...however I would like to ask...I have a reference like that, however the formulary is used in a Public link...for the public link this reference qualifier is not working...maybe do I need to add anything else? this is my code:

 

javascript:'u_categor_a_a_la_que_pertenece_el_bien_o_servicio='+current.variables.bienes_servicios;

 

In addition I have created an ACL for the table and specific field I'm trying to consult, but it doesn't work.

Thanks for your help!

Hi Marco,

Did you ever find a solution to this?

Julian Hoch
ServiceNow Employee
ServiceNow Employee

Sure. For example, to restrict the Configuration Items on the Incident form to the ones managed by the assigned to (artificial example, I know), use the following advanced reference qualifier:



javascript:"managed_by="+current.assigned_to