There have been some client API enhancement in Dynamics 365 (V9) as mentioned in the What's new for developers article. We've got some new functions in Xrm.Navigation namespace ;
- openAlertDialog
- openConfirmDialog
- openDialog
- openErrorDialog
- openFile
- openForm
- openTaskFlow
- openUrl
- openWebResource
OpenAlertDialog
In previous version of Dynamics 365 , "Xrm.Utility.alertDialog" function is used for alert notifications. With the new version it is replaced by "Xrm.Navigation.openAlertDialog" . you can see how it's working and the code below.
In previous version of Dynamics 365 , "Xrm.Utility.alertDialog" function is used for alert notifications. With the new version it is replaced by "Xrm.Navigation.openAlertDialog" . you can see how it's working and the code below.
function NameOnChange(executionContext) {
var alertStrings = {
title: "Account Name",
text: "Account Name is changed as '" + executionContext.getEventSource().getValue() + "'",
confirmButtonLabel: "Continue"
};
var options = {
height: 200,
width: 600,
};
Xrm.Navigation.openAlertDialog(alertStrings, options)
.done(function () {
alert("Alerted");
});
}
OpenConfirmDialog
var confirmStrings = {
title: "New Confirm",
text: "Do you want to proceed with new confirm dialog",
subtitle: "Please confirm",
confirmButtonLabel: "Proceed",
cancelButtonLabel: "Abort",
};
var options = {
height: 200,
width: 600,
};
Xrm.Navigation.openConfirmDialog(confirmStrings, options)
.done(function () {
var confirmDialogResponse = arguments[0];
if (confirmDialogResponse.confirmed) {
alert("Proceed");
}
else {
alert("Abort");
}
});
No comments:
Post a Comment