Hi Sharon Steiner,
Kindly place the below js code in html snippet and enable javascript with jquery.
if wants this functionality across all the pages you have to place the snippet in the layout that is being used.
you can place the snippet top of the page, if you want for this in specific page.
window.onbeforeunload = function(e){
var msg = 'Are you sure?';
e = e || window.event;
if(e)
{
e.returnValue = msg;
}
mx.data.action({
params: {
actionname: "ModuleName.MicroflowName"
},
origin: this.mxform,
callback: function(obj) {
// no MxObject expected
alert("Just petted the cat a little");
},
error: function(error) {
alert(error.message);
},
onValidation: function(validations) {
alert("There were " + validation.length + " validation errors");
}
});
return msg;
}
Thanks.
Hi Sharon Steiner,
There is a java action “ executeMicroflowInBackground” available in Community commons to execute microflow in background . So you can use it.
For more details refer:
https://docs.mendix.com/appstore/modules/community-commons-function-library/#36-execute-microflow