The CreatorCon Call for Content is officially open! Get started here.

Reference Qualifier Controlled by a specific field value

tech_tc
Mega Contributor

How can I apply a reference qualifier   to a department reference list. I want to control what the current user can see by a specific value in another field on the department table. I'm using Calgary so can't benefit from Eureka improvements for creating ref qualifiers.


For e.g. of what I'm trying to achieve.

All departments have a field called 'SSGROUP' (u_ssgroup on the cmn_department table). If we add the value 'ITDept' to this field, the user filling out a 'New Starter' form, should only see departments that have the 'ITDept' value in place. Query like u_ssgroupSTARTSWITHITDEPT

Access to the relevant departments is done by groups. e.g. the ITFILTER group on the sys_user_group table.

Can this be done as an Client Script on its own, or a client script calling a script include? I really could do with some help developing the scripts.

1 ACCEPTED SOLUTION

actually you dont need a onload script to pull the reference qualifier and put it to a field .... use the reference qualifier script in reference qual field as below



Reference qual for u_ssgrp : javascript: new userUtilsAjax().getUserDepartment()


View solution in original post

10 REPLIES 10

Kalaiarasan Pus
Giga Sage

Reference qualifier is there on Calgary too just personalize the form and add the field to the layout if not already present.



http://wiki.servicenow.com/index.php?title=Reference_Qualifiers


Your quite right.


I did see this reference before, but I was referring to Eureka making this task simpler by using condition builders which would of been easier for me, since my scripting skills are not strong. Hence asking for assistance to script this function. Thanks all the same.


Just try adding this in your field's reference qual



u_ssgroup=ITDEPT


Hi


I've personalised the form but had to add the reference qualifier filter query in manually on the field called SGGgroups. The drop down list then works fine.


Is there a way to auto populate the reference_qual field with a query based on a users Group?



TC