web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :

D365 V9{Upgrade}: Client API update for alert and confirm

AjitPatra Profile Picture AjitPatra 469

In D365 V9, as per Microsoft documentation, Xrm.Utility.alertDialog() should be replaced by Xrm.Navigation.openAlertDialog() and Xrm.Utility.confirmDialog() should be replaced by Xrm.Navigation.openConfirmDialog().

Let’s take an example of both alert and confirm dialog box and see what exact changes we need to do in JS code apart from the above library change.

alert:

D365 V8:

Xrm.Utility.alertDialog("Message");

D365 V9:

Xrm.Navigation.openAlertDialog({ confirmButtonLabel: "OK", text: "Cancel Button Pressed" });

a

confirm:

D365 V8:

Xrm.Utility.confirmDialog(message, function(){

//Do something on click of OK.

});

D365 V9:

var confirmStrings = { text: "Do you want to change case status to 'Accepted (Closed)'.", title: "Confirmation Dialog" };
var confirmOptions = { height: 200, width: 460 };
Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
function (success) {
if (success.confirmed)
{
//Do something on click of OK.
}
else
//Do something on click of Cancel.
});

b

Hope it helps !!


This was originally posted here.

Comments

*This post is locked for comments