Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2021 09:02 AM
Sounds like you want a dialog window.
GlideDialogWindow: Advanced Popups Using UI Pages - ServiceNow Guru
But for service portal you need to use the widget-modal. Here is something I used to open one.
//Client HTML
<sp-widget widget="data.modalInstance" ng-if="data.modalInstance"></sp-widget>
//Client Script
$scope.openModal = function(ev, table, sysid, query, view){
if(!sysid)
sysid = -1;
spUtil.get("widget-modal", {embeddedWidgetId: "widget-form",
embeddedWidgetOptions: {table: table,
sys_id: sysid,
view: view,
query: query,
disableUIActions: "true",
hideRelatedLists: true
}
}).then(function(widget){
var modalCtrl;
var unregister = $scope.$on('sp.form.record.updated', function(){
//Do work here when record updated and then close modal
modalCtrl.close();
});
widget.options.afterClose = function(){
unregister();
$scope.data.modalInstance = null;
modalCtrl = null;
};
widget.options.afterOpen = function(ctrl){
modalCtrl = ctrl;
};
$scope.data.modalInstance = widget;
});
}