- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 07:36 AM
Experts,
I have a requirement to change the confirm default button text from (ok/Cancel) to (Submit/Attach) when submitting a record producer from Portal.
For Spmodal.open, we have the option to pass buttons parameter to show on the dialog, but I am not sure how we can pass it for spmodal.confirm.
Please let me know if you have any solution/workaround for this.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 10:21 PM
Hi,
Please use below code and check if it works for you.
Having your own widget to show as a popup gives you flexibility on what goes inside it.
Call g_user.showModalDialog - as per your requirement.
--> Write this in onLoad catalog client script
g_user.submitClicked = false;
g_user.showModalDialog = function(msg) {
if(NOW.window) { //Service portal
var shared = {};
shared.message = msg;
var popupOptions = {
title: 'title_name',
widget: 'id_of_the_widget_that_contains_what_should_be_there_in_popup',
widgetInput: 'any inputs that need to be passed to the widget',
shared: shared,
footerStyle: {display:'none'}
};
if(! g_user.submitClicked) {
g_user.submitClicked = true;
var modalInstance = spModal.open(popupOptions).then(function() {
g_form.submit();
}, function() {
g_user.submitClicked = false;
});
}
} else {
//Code to open popup in platform (you can use glide_confirm_standard)
}
};
--> Write this in onSubmit catalog client script
if(g_user.submitClicked)
return true;
return false;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 07:39 AM
I dont think you can do that with spmodel.comfirm(it works like Javascript confirm).I would say use spmodel.open.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Pranav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 09:18 AM
Yes correct; confirm don't have more options/params. Try Open as below.
spModal.open({
title: 'CONFIRM',
message: $scope.data.msg_confirmation,
buttons: [{label: 'Attach', value:2},
{label: 'Submit', value:1, primary: true}
]
}).then(function(response) {
if (response && response.value == 1){
$scope.doSubmit();
}else if (response && response.value == 2){
$scope.doAttach();
}
},function(){
});
Chirag A
SNOW Dev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2020 01:57 PM
Thank you. So to simulate the ok (complete submission), cancel(go back) do we know what code you add in dosubmit and doAttach?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 10:45 AM
Any suggestions?