advanced reference qualifiers

chazz1
Mega Contributor

I am attempting to utilize advanced reference qualifiers at per the instructions at

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

I am trying to get the value of the 'user' field into the reference qualifier function. the instructions say to add "ref_qual_elements=user" to the attributes field of the dictionary entry for the field. And to access that field you would use "current.user" in the script to access the field. This does not appear to be true. the script blows up saying 'current' is not defined. the wiki entry is not clear on how you access the variable in script. how do i do that?

4 REPLIES 4

Jim Coyne
Kilo Patron

Can you post the Script Include you are trying?

Is your user field a choice type reference, or just a regular reference field?


chazz1
Mega Contributor

i am attempting to pass a user parameter to the getMyAssignments() function of the getMyApprovals global business rule.
We have implemented Time cards. When a user is filling out the time card they can pick a task that they want to associate the time card with. the reference qualifier works fine to get the logged in user's tasks, but we want it to look at the time card's user field to filter that list. There are times when a manager has to fill in time cards for another person.

on the time card the task field is a reference, that brings up a list when clicking the spy-glass. I followed the instructions on the wiki to no avail. the wiki hints at, but it is not clear, that this can only be done with a choice list field?


Jim Coyne
Kilo Patron

Take a look at the Time Cards application in demo010. I added the following to the Reference Qualifier field on the "task" column definition:



javascript:'assigned_to='+current.user;


Is that what you are looking for?


chazz1
Mega Contributor

that did the trick. i did try something similar the other day that didnt work. I guess i was close, but not close enough.

assigned_to=current.user

That inline javascript stuff can be quite confusing. both in how the syntax works and when to use it.

I did not add it to the column definition as you mentioned but to the reference qualifier field of the task field's dictionary entry.

Thank you.