RE: Alert dialog box with yes or no options in Dynamics 365
Hi sreevalli,
Thank you for sharing the code.
I implemented the code like this for appointment entity which displays an dialog box after saving the form,
on the dialog box i am able to see the cancel and ok button .clicking on the ok closes the box but the record is being saved even though i click cancel.
Please help me
function onSave() {
if ((Xrm.Page.getAttribute("requiredattendees").getValue() != null) ||
(Xrm.Page.getAttribute("optionalattendees").getValue() != null) ||
(Xrm.Page.getAttribute("subject").getValue() != null))
{
var confirmStrings = { text: "An Outlook invitation will now be sent out to all selected participants. Do you wish to proceed?", title: "Outlook Invitation" };
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
executionContext.getEventArgs().preventDefault();
}
);
}
}