- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2016 12:27 PM
In service portal, I am using the ticket form and referencing TableA (the parent table in this scenario). When this page opens and displays the ticket information, I want to show a table as well that contains all child tasks from TableB with the parent# of the incident I have open on this page. The URL shows the SYS_ID of the parent item, so I'm assuming there may be a way to use table by url definition maybe? I'm not really sure.
Anyone have any insight on how I could accomplish this? Below is the sample URL:
Tagging a few people from previous posts as well. Hope you don't mind!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 12:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 07:19 AM
No problem Robert,
If you could send me a picture of your url that would help me. However I am gonna assume some things and you can give this a try in the server side code of your simple list widget. (I am also assuming what reference field you are using for parent task)
______________________________________________________
var currentTaskID = $sp.getParameter("sys_id");
var taskGR = new GlideRecord('task');
taskGR.addQuery('sys_id', currentTaskID);
taskGR.query();
var encodedQuery = '';
if ( taskGR.next() ) {
encodedQuery = 'parent.sys_id=' + taskGR.parent.sys_id + '';
}
//Replace what options.filter means
var options.filter = encodedQuery;
______________________________________________________
I hope this helps, let me know if you have anymore questions.
Best Regards,
Philip Engles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 09:55 AM
How would I replace the options.filter? The below is what code shows for options.filter:
gr.addEncodedQuery(options.filter);
options.title = options.title || gr.getPlural();
options.display_field = $sp.getParameter('f') || options.display_field;
if (!options.display_field || !gr.isValidField(options.display_field))
options.display_field = gr.getDisplayName();
if (input && input.filterText) {
gr.addEncodedQuery(options.display_field + "LIKE" + input.filterText)
}
options.title = options.title || gr.getPlural();
options.secondary_fields = options.secondary_fields || "";
options.secondary_fields = options.secondary_fields.split(",");
if (!options.order_by || !gr.isValidField(options.order_by))
options.order_by = options.display_field;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 10:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 10:39 AM
Ok, that make sense. From that point, I need to get the new encodedQuery in as the parent.sys_id on the table from instance definition widget. So if I set the table to "task". I need the parent.sys_id = encodedQuery since that will be the sys_id of the opened record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2016 11:25 AM
Seems like I was able to help If you could do me a favor and mark my response as an answer to your question I would greatly appreciate it! BTW it would be the is the "current" task ticket's parent's sys_id. I would do some reading on Dot Walking you can see I did a manual dot walk when I created my encoded query string.