- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 11:34 AM
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.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2014 07:46 AM
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()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 11:58 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 01:19 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 07:02 PM
Just try adding this in your field's reference qual
u_ssgroup=ITDEPT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 07:15 PM
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