- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 07:52 AM - edited 02-15-2024 08:04 AM
1) For the Portal Object Widget, THIS page says for the Record option, "If this field is empty, the widget displays information based on the sys_id parameter provided in the portal web page URL." but if I leave the field blank, it shows and uses the default example from the alm_asset table. How do I get it to pull the sys_id from the URL?
2) For the Portal Data List Widget, it works great for just providing a list such as replacing the default list widget on (a clone of) the my_projects page (which comes with the 'Customer Project Management'/sn_csm_ppm plugin). However, can this be used on a Record Page to show sub lists? If I place it on (a clone of) the project_detail page, a) it doesn't pick up the project record and rather than showing the Contacts for that Customer Project, it instead shows all Contacts. (As well, if I click on a Category, the URL loses the sys_id shown before I select a Category) How can I get it to filter? THIS page doesn't give options on the query line
I've tested with Vancouver Patch 6 and Washington Patch 0 and the latest version 3.3 of the 'UI Components for Customer Portals' plugin
Thanks!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 10:33 AM
You'd need to modify the widget and put it in the Server Script field, entering it in the field like that won't work. Then from the server script pass it to the client controller or HTML template.
Something similar to the below to pass the data.
Server Script:
var id = $sp.getParameter('sys_id');
Client Controller:
c.id = $scope.data.id
HTML Template:
{{c.id}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 09:43 AM
ServiceNow responded:
#1 is a known bug which they are working on
#2 is an enhancement on their roadmap
Based on this, I am accepting previous suggestion
Changes made to Server Script of Portal Object widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 09:23 AM
I believe you can do $sp.getParameter('sys_id') or what ever you named it and that'll pull the value from the URL and then you can use it in your widget. Similar to the form-widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 09:40 AM
Unfortunately, that does not work. See screenshot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 10:33 AM
You'd need to modify the widget and put it in the Server Script field, entering it in the field like that won't work. Then from the server script pass it to the client controller or HTML template.
Something similar to the below to pass the data.
Server Script:
var id = $sp.getParameter('sys_id');
Client Controller:
c.id = $scope.data.id
HTML Template:
{{c.id}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 10:53 AM - edited 02-15-2024 10:54 AM
Ideally, we shouldn't need to customize the widget in light of the documentation on the Record field, but yes, found where to modify the 'Portal Object' widget. Thanks!
Now on to the second question. May need to delve into the Widget code there as well. Though I'd be interested in finding out if there's a way to configure rather than edit the Portal Data List configurable widget.