Hi,
I have implemented openConfirmDialog
on the save event. Though it is showing the popup with all the values but it is not preventing save i.e. on click of save, popup appears for confirmation but the form saves even before I select anything on the confirm dialog.
Auto save is not enabled.
Xrm.Utility.confirmDialog works fine.
Does any one else faced this issue?
Here is my code-
----------
function OnSave() {
var isCreateChildDirty = Xrm.Page.data.entity.attributes.get("new_createchildcases").getIsDirty();
var isCreateChild = Xrm.Page.data.entity.attributes.get("new_createchildcases").getValue();
if (isCreateChildDirty == true && isCreateChild == true) {
var confirmStrings = { text: "Are you sure you want to create child records for the current total count?", title: "Create Child Cases", subtitle: "Create child cases for the the current total count", cancelButtonLabel: "Cancel", confirmButtonLabel: "Confirm" };
var confirmOptions = { height: 200, width: 500 };
Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(function (success) {
if (success.confirmed)
Xrm.Page.getControl("new_createchildcases").setDisabled(true);
else
Xrm.Page.getAttribute("new__createchildcases").setValue(false);
});
}
}
---------------
*This post is locked for comments