Popup catalog client script with buttons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2025 11:07 PM
Hi,
I need to create an onLoad catalog client script on my catalog item that will pop up a message:
"do you want to continue?"
and under will be two buttons:
"Yes" and "No"
If the user will click on 'Yes' the pop up will be closed and he will stay at the same page.
If he will click 'No' then he needs to redirect to Service Portal homepage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2025 02:00 PM
Hi @Community Alums
What is the use case for this? To load a catalog item and immediately be asked if you want to continue isn't a great User Experience.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2025 08:24 AM
Hi @Community Alums,
This script opens a spModal onLoad:
The property noDismiss hides the header and prevents the popup from being closed from the X corner button.
function onLoad() {
spModal.open({
title: "Do you want to continue?",
message: "Do you want to continue?",
buttons: [
{ label: "Yes", primary: true },
{ label: "No", cancel: true }
],
backdrop: "static",
keyboard: false,
noDismiss: true
})
.then(
function() {
// YES clicked
},
function() {
// NO clicked
var redirectURL = '/sp';
top.window.location = redirectURL;
}
);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2025 10:20 PM
@frviuf the problem with this solution is that if the user click 'No', then before being redirected to sp he get asked again if he wants to leave without saving the changes, is there any way to prevent that message?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2025 10:21 PM
