- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2019 04:06 PM
Hi All,
I am currently scoping order guides and the functionality.
One thing I am noting on Step 2 of the guide there is a previous button.
If that button is selected then it will go back to the previous screen but the data on step 2 will be lost.
I want to put a confirmation message for the end users when previous is selected display popup
"All your current information will be lost, Do you wish to continue?"
I have found the following in the order guide widget but my lack of coding knowledge is not helping. How can I add a confirmation popup that if ok is selected it proceeds, if cancel is selected it stays on the current screen
HTML -
<div class="pull-right">
<button ng-hide="guide_step != 1 || submitted" name="submit" ng-click="goPrev()" class="btn btn-default padder pull-left-xs" ng-class="{'m-r-6': guide_step < 2}">{{::m.prevMsg}}</button>
Server script -
m.prevMsg = gs.getMessage("Previous");
Client controller -
$scope.goPrev = function() {
$scope.includedItems.forEach(function (item) {
item.isOpen = false;
})
$scope.guide_step--;
if($scope.guide_step==0)
spSCNavStateManager.unregisterForms(Object.keys(includedGformInstances));
}
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2019 04:31 PM
You could use spModal.confirm() inside of the #scope.goPrev function block. See docs below it has helped me in the past it's pretty handy
https://developer.servicenow.com/app.do#!/api_doc?v=madrid&id=SPM-confirm_S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2019 05:07 PM
Thanks for the reply John, As soon as I use the spModel function in the order guide it breaks the order guide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2019 05:40 PM
Ignore that. i found that the function was already being called above. Still no luck though. i will keep trying.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2019 09:14 AM
Hi Nicole,
Can you share the code with me that you have so far?
Thanks,
John