- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2016 02:14 PM
We have a scoped application to track security exceptions that are created for users. The table for the application is extended from Task and Requested By is the field that specifies the user for whom the exception was created.
I want to add a related list to the Incident form that will display any security exception records for the caller. I've created a relationship. Applies to table is set to Incident. Queries from table is set to the Security Exceptions table. Below is what I have in the Query with but that display all the exceptions for every user - not just the current caller on the incident. What do I have wrong here?
(function refineQuery(current, parent) {
current.addQuery('caller_id','requested_by')
})(current, parent);
Solved! Go to Solution.
- Labels:
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2016 07:17 PM
I was just re-reading the docs. Try switching the query around.
current.addQuery('requested_by', parent.caller_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2016 02:54 PM
Try this instead:
(function refineQuery(current, parent) {
current.addQuery('caller_id', parent.requested_by);
})(current, parent);
http://wiki.servicenow.com/index.php?title=Creating_Defined_Related_Lists#gsc.tab=0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2016 06:12 PM
Hi Chuck - I tried that and still get a list of all the exceptions and not just the ones for the current caller.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2016 06:33 PM
Hi Sharon,
Can you share a screenshot of the entire defined relationship record? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2016 07:10 PM
