Pop-up JavaScript changes in Dynamics CRM 2013

Often times we created scripts with alerts to the user, or getting some sort of simplistic interaction with the user. Some of those do change in Dynamics CRM 2013.

If we used window.alert or window.confirm now it’s time to stop that. The new SDK has a warning for us to use the newly provided functions.

alertDialog

instead of using window.alert now the recommended way is to use

Xrm.Utility.alertDialog(message, onCloseCallback);

confirmDialog

instead of using the old window.confirm now we should use

Xrm.Utility.confirmDialog(message, yesCloseCalback, noCloseCallback);

Observe the use of the callback function to continue processing your business flow.

Unfortunately these are only available for the entities where the UI has been updated, but they will definitely come in handy.

The change was prompted by the support for all browsers, and the use of tablets and other devices. On tablets, calls to functions that block the flow of code is not allowed.

Enjoy!

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 )

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s

A WordPress.com Website.

Up ↑

%d bloggers like this: