Default value of caller field

sharmavikrant
Kilo Expert

Hi Guys, I am trying to set the default value of the caller field. The below code is already there, I want to show only the caller who are active could you please help me with the rest of the code?

 

javascript:incidentGetCaller();

1 ACCEPTED SOLUTION

marcguy
ServiceNow Employee
ServiceNow Employee

No need to change the default value if you only want to return active users, just update the 'Reference Specification' tab and the Reference Qual Condition to ACTIVE is TRUE.



Then if you don't auto-populate the caller field with the current user and need to lookup users, it will only return active-true users, is that your intention?



By default that incidentGetCaller() will autopopulate the caller field if the user logging the incident is not an itil user, otherwise it presumes they are logging a call on behalf of someone so will use the reference qualifier to only show you active users.


View solution in original post

5 REPLIES 5

marcguy
ServiceNow Employee
ServiceNow Employee

No need to change the default value if you only want to return active users, just update the 'Reference Specification' tab and the Reference Qual Condition to ACTIVE is TRUE.



Then if you don't auto-populate the caller field with the current user and need to lookup users, it will only return active-true users, is that your intention?



By default that incidentGetCaller() will autopopulate the caller field if the user logging the incident is not an itil user, otherwise it presumes they are logging a call on behalf of someone so will use the reference qualifier to only show you active users.


Subhajit1
Giga Guru

Hi Vikrant,


If you want the caller field to be populated by the Logged in User, the code for that would be:-


javascript:gs.getUserID().



If you want to show only the active users on look up, add active=true in the reference qualifier field of the dictionary entry of the caller field.



Thanks,


Subhajit


Yep - javascript:gs.getUserID(); is one of the most valuable strings to use in filters and form etc!


sharmavikrant
Kilo Expert

Thanks Guys, Sorted.