Hi,
i tried to prevent saving a record, however the record still gets saved. i dont know how to debug this problem, since there is no feedback.
here my code
function preventSave(econtext) {
var eventArgs = econtext.getEventArgs();
var formContext = econtext.getFormContext();
var requesttype = formContext.getAttribute("go_requesttype").getValue();
if ((eventArgs.getSaveMode() == 70 || eventArgs.getSaveMode() == 2 || eventArgs.getSaveMode() == 1 || eventArgs.getSaveMode() == 59) && requesttype == 936520001) {
var confirmStrings = { text:"You are about to delete this record and associated records.", title:"Delete Confirmation" };
var confirmOptions = { height: 200, width: 450 };
Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
function (success) {
if (success.confirmed){
console.log("Dialog closed using OK button.");
}else{
console.log(eventArgs);
eventArgs.preventDefault();
console.log("Dialog closed using Cancel button or X.");
}
});
}
}


any ideas? am i using this method correctly?