Microsoft Dynamics CRM 2013 Mobile Client and JavaScript: Do they play nice together?

By - March 24, 2014

As with most Microsoft Dynamics CRM implementations, there tends to be an abundance of JavaScript that accumulates on the forms over time.  Whether it’s a new implementation or an existing one, as new functionality is needed JavaScript tends to be a pretty efficient way to build real-time functionality into the form.

With the introduction of the Mobile App for Microsoft Dynamics CRM 2013, there are some new Xrm.Utility and Xrm.Page.Context reference’s available.  JavaScript is supported within the context of the Dynamics CRM 2013 Mobile App but issues can quickly arise if you are not careful.  The mobile app can be very touchy to certain customizations so it is best to make sure that for each entity that has mobile access enabled you thoroughly check the JavaScript and make sure there is nothing that is unsupported.

Some things that are not necessarily unsupported but may cause issue in the Mobile App are JavaScript message boxes.  If you are used to using something like alert (“Be sure all options are filled out before saving the form.”) or confirm(“Do you want to assign this record to another sales rep?”), you should switch to the following method to make sure its compatible with the mobile app.

  • Xrm.Utility.alertDialog(“Insert Text Here”);
  • Xrm.Utility.confirmDialog(“Insert confirm statement here”);

One of the other new JavaScript references that has been added is the ability to check the client type.  There are currently 3 client types available – Web, Mobile, and Outlook.  This is helpful because you can check the client type and decide if you should let the script run based on how the user is accessing the system.  To check the client type you should use the following reference.

  • Xrm.Page.context.client.getClient();

These are just a few things to keep in mind when writing scripts that may have to be accessed by the mobile client at some point in time.  Mobile access is becoming more of a necessity today than it ever has before so make sure you’re thinking ahead of the curve when doing custom development.

If you need troubleshooting support for Microsoft Dynamics CRM 2013, RSM offers a full range of services from implementation and optimization to development and support. Contact our professionals for more information on our services at 855.437.7202 or

Read more articles on the new release of Microsoft Dynamics CRM 2013.

By John Annunziato – Pennsylvania Microsoft Dynamics CRM partner

Receive Posts by Email

Subscribe and receive notifications of new posts by email.