Caller field reference qualifier dependent on Company OR MyCompany
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 02:36 PM
I have a simple reference qualifier setup for the Caller field which is dependent on the Company field. Works fine.
My issue is that I need the reference qualifier to allow Users from the value in the Company field OR my own Company which is called Novitex.
Can I create this OR using the Condition Builder or do I need javascript? I'm not really a coder but can usually get by with some examples.
The Dependent field is Company.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2017 12:10 AM
Hi Ralph,
You can add your condition in the reference qualifier and set the company field to "YOUR Company".
This will give you the users of your company in the caller field.
No scripting is required.
Thanks,
Priyadarshini
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2017 05:50 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2017 07:12 AM
You can remove the dependency on company, and use a script includes to get the current company and your company.
For the caller field, add this plus the name of the script includes: javascript:getCompanies() (getCompanies() is example)
Then script includes looks like this:
function getCompanies() {
var retval = "sys_idIN";
var comp = new GlideRecord('sys_user');
var qc = comp.addQuery('company', current.company);
//change sys id to your company
qc.addOrCondition('company', 'df7d53303710200044e0bfc8bcbe5dac');
comp.query();
while (comp.next()) {
retval += comp.sys_id + ",";
}
return retval;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2017 08:35 AM
Your suggestion looks exactly like what I need but I'm having difficulty implementing it.
I haven't used script includes before so I am not exactly sure how to implement your suggestion.
I see a framework automatically inserted into the include when I create it but I am not sure where to drop your code in or replace that framework altogether. If I drop your code in, I receive a couple of errors about missing brackets. Also not sure about the Javascript call that goes into the Reference qualifier field.
I named the Script Include enhancedCaller
Here's where I am at currently;
Javascript Call
Script Include