- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2018 11:32 PM
Hi,
We have a requirement to preview the notification of the custom table in service portal. We have configured a ui action client callable and used the Glide Dialog class to invoke inline template "notification_display.xml" in normal GUI. But the same doesn't work on service portal as Glide Dialog class is not supported in service portal. Can i get some help in alternate solution for previewing the notification in portal pages
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2018 08:58 AM
+1 to Brad's answer. I would recommend option 1. It shouldn't be too difficult,
You'll get the HTML from a GlideRecord on the Notification referenced, and then bind that to the HTML with angular in a modal window.
I'm not sure how everything is working on your page, but here's a pseudo example. This is untested.
Also, I'm going to assume the sys ID of notification you want to preview is a parameter in the URL.
HTML– the first part is a button that when clicked opens the modal window, and then the <script> part is the modal window where we are going to bind the HTML we get from the GlideRecord.
<div>
<button class="btn btn-primary" ng-click="c.openModal()">${Preview Notification}</button>
</div>
<script type="text/ng-template" id="previewNotification">>
<div ng-bind-html="::data.notificationHtml"></div>
</script>
Client Controller
function($uibModal, $scope, $sce) {
var c = this;
$scope.data.notificationHtml = $sce.trustAsHtml($scope.data.notificationHtml);
c.openModal = function() {
c.modalInstance = $uibModal.open({
templateUrl: 'previewNotification',
scope: $scope
});
}
c.closeModal = function() {
c.modalInstance.close();
}
}
Server script
(function() {
var notificationId = $sp.getParameter('sys_id');
var nt = new GlideRecord('sysevent_email_action');
nt.get(notificationId);
data.notificationHtml = nt.message_html;
})();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2018 06:47 AM
The main issue here is that you can't display a jelly page (ui page/ui macro) in the service portal. You've got a few options:
- Build your own preview widget in Service Portal
- Open the preview in a new tab where you can render the jelly. You might need to write a ui page that calls the notification_display template.
- Use a service portal modal that has an iframe in it where you can build a page that will call the notification display template.
Unfortunately, all of the options are going to require a bit of work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2018 08:58 AM
+1 to Brad's answer. I would recommend option 1. It shouldn't be too difficult,
You'll get the HTML from a GlideRecord on the Notification referenced, and then bind that to the HTML with angular in a modal window.
I'm not sure how everything is working on your page, but here's a pseudo example. This is untested.
Also, I'm going to assume the sys ID of notification you want to preview is a parameter in the URL.
HTML– the first part is a button that when clicked opens the modal window, and then the <script> part is the modal window where we are going to bind the HTML we get from the GlideRecord.
<div>
<button class="btn btn-primary" ng-click="c.openModal()">${Preview Notification}</button>
</div>
<script type="text/ng-template" id="previewNotification">>
<div ng-bind-html="::data.notificationHtml"></div>
</script>
Client Controller
function($uibModal, $scope, $sce) {
var c = this;
$scope.data.notificationHtml = $sce.trustAsHtml($scope.data.notificationHtml);
c.openModal = function() {
c.modalInstance = $uibModal.open({
templateUrl: 'previewNotification',
scope: $scope
});
}
c.closeModal = function() {
c.modalInstance.close();
}
}
Server script
(function() {
var notificationId = $sp.getParameter('sys_id');
var nt = new GlideRecord('sysevent_email_action');
nt.get(notificationId);
data.notificationHtml = nt.message_html;
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2018 12:23 AM
Thanks Josh for your inputs, i provided the ui page URL in the templateUrl and it's working fine.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2018 09:29 AM
On top of the answers above, I think those are great answers, but I would even go further to build a service portal widget that and display generic UI page.
Now this sound massive but it's already there (almost): there is an out of box widget called sc_view which display the default view of any form on the service portal side. Now as we all know a view is really just a UI page. so I suspect it should be quite easy to build something similar that display all your custom UI page which should have the OOB jelly tags and functions in there. And you can probably reuse it...
... I need to propose this idea to my boss ..