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

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.


D365 V8:


D365 V9:

 var alertStrings = { confirmButtonLabel: "OK", text: "Cancel Button Pressed" };
var alertOptions = { height: 100, width: 400 };



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.
//Do something on click of Cancel.


Hope it helps !!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.