
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2016 12:12 PM
SN Community-
I've been thrown into the world of PRB/CHG/INC tickets.
One task that was asked is:
Please create a related list on the INC which shows the associated PRB.
Now there is already a field under Related Records for the problem:
This is sufficient, BUT the customer would like a related list tab showing the same problem.
I started off by creating a Relationship
Applies to table: Incident
Queries from table: Problem
Queries with: current.addQuery(sys_id, parent.problem_id);
When I add this related list to the Incident form, I do get the associate problem with the INC, but I also get ALL problems, not just the one associated with the parent INC
I'm guessing the Queries with statement is incorrect.
Am I close to getting what I need?
Note: the variable 'problem_id' on the INC form is a reference field to the Problem table. I thought by getting the sys_id (parent.problem_id) and matching it with the sys_id of the problem, I'd get the result I need
Any help is greatly appreciated-
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2016 12:17 PM
Your addQuery has no ticks:
current.addQuery('sys_id', parent.problem_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2016 12:18 PM
Hi Matthew,
I think their is no need to create new relationship here.. OOB we have same functionality.
go to configure->related list. search for problem task->parent and move it to selected slushbucket.
Thanks & regards
Govind Kumar Sharma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2016 02:33 PM
Hi Matthew,
See Mike's first post for the correct answer (use the existing related list available "Problem-->Parent").
However, one note on your original query. Invalid query conditions are by default ignored and will return all records.
To avoid this, either:
- use "gs.getSession().setStrictQuery(true);" in your scripts prior to querying a GlideRecord
- or set your system property: glide.invalid_query.returns_no_rows = true
Thanks,
-Brian