CRM 2013 have added 2 new methods alertDialog and confirmDialog. These new methods have been added by keeping Tablets in mind. Instead of using window.alert and window.confirm we need to use these two new methods to display message to the user.

  • Xrm.Utility.alertDialog(message,onCloseCallback)
  • Xrm.Utility.confirmDialog(message,yesCloseCallback,noCloseCallback)

 

Usage:-

 

Xrm.Utility.alertDialog("Message on alert dialog", function () {

// Change the subject after the alert dialog is closed

Xrm.Page.getAttribute("subject").setValue("New Subject");

});

 

Xrm.Utility.confirmDialog("Message on confirm dialog", function () {

Xrm.Page.getAttribute("description").setValue("Yes call back selected");

 

}, function () {

Xrm.Page.getAttribute("description").setValue("No call back selected");

});

 

AlertDialog

 

ConfirmDialog

On Selecting OK à

 

On Selecting Cancel à

 

Cheers,

Shraddha Dhingra