Dynamics 365 – Mobile Offline

I recently configured the mobile offline capability for Microsoft Dynamics 365 for phones and tablets. This post describes the process and highlights a few challenges I needed to resolve.

The Dynamics 365 mobile offline feature utilizes Azure to make data available for offline use. Meaning a copy of your data capable of being synchronized offline will be held in the Azure cloud. The mobile app makes use of a SQL Azure database to download the data to a local database.

Mobile Offline

From a user’s perspective using the mobile client offline is really easy. (Making this a great feature.)

If your internet connection drops you will automatically be put into offline mode. You can tell this from the red tab that appears. You will also be warned that you might not see complete data.

There is also a prompt that says when your data was last synchronised. I am not 100% sure how often the sync process runs but it seems to be every 20 to 30 minutes.

You can also see which entities are available offline and if their sync is up-to-date by viewing the side menu. Each entity that is available offline will have eother a green (or red) bar at the side of their icon. With a red bar suggesting that the data might not be synchronized.

Whilst offline some views of data might not be available. Typically this will be because the view is referencing an entity that isn’t available. When this happens you will see a message similar to the one below.

To go back online, simply select the offline option and select reconnect. (Obviously after you have an internet connection again!)

To enable the mobile offline capability, you need to follow 5 steps;

  1. Enable mobile offline synchronization.
  2. Enable entities for mobile offline synchronization.
  3. Create a mobile offline profile.
  4. Add users to a mobile offline profile.
  5. Publish a mobile offline profile.

Step One – Enable mobile offline synchronization.

Before you attempt to enable mobile offline synchronization, there are some things to keep in mind;

  • You can only enable offline sync in a production environment. (Trials, previews and sandbox organizations are not supported.)
  • You need a minimum of 5 professional (online) licenses or at least 1 Enterprise Dynamics 365 (online) license.
  • The required licenses must be actually assigned to users prior to starting the synchronization.

You will find the open to enable mobile offline in the “Mobile Offline” area of settings.

In the mobile offline menu, select “Mobile offline configuration”.

Assuming all of the pre-requisites have been met you should be able to start provisioning. This does take some time!

Eventually when the provisioning is complete you can continue to step two.

Step Two – Enable entities for mobile offline synchronization.

By default, several system entities are enabled for offline. These include;

Account, Appointment, Attachment, Competitor, Competitor Address, Contact, Email, Lead, Note, Opportunity, Opportunity Product, Product, Task, Case, Queue, Queue Item, SLA KPI Instance, Entitlement, Team and User.

You can edit the properties of additional entities in customizations to enable them for offline. To do this each entity will need to have the enable for mobile offline property selected. Doing this will also automatically select the change tracking option. (It is not possible to disable this option if you wish to use offline mode.)

You must also use the “Organization data download filter” setting on all the entities you wish to take off line. Here you can set up to three criteria to define what data should be taken offline. To ensure the system performs as fast as possible and to minimize data charges whilst working on cellular networks you should try to keep the volume of offline data to a minimum.

Tip:
After making the required changes, make sure you publish your changes!

Step Three – Create a mobile offline profile.

Next you will need to define a mobile offline profile. This further defines what data should be taken offline and also which users will be applied to each profile. Initially you will find a couple of sample profile exist, I found it useful to review these to understand how they are configured.

You can see below that I created a profile for our field sales team.

The profile will list all of the details for each entity.

On an entity, you can define if all records should be downloaded or if only related items. Below you can see that I have set the filter on account to download “my” records. If the organizational filter on accounts said account modified in last 14 days, this profile would then mean I would see my accounts that have been modified in the last 14 days.

Below you can see that I have opted to download all my competitor records. I have then defined a relationship to “competitor address”. As I only want to download the competitor address data for the competitors that are synchronised. Another example might be that Id’ want to sync all of the opportunities I own. And then sync all of the opportunity product records related to those opportunities.

Competitor address will also need to have an entry in my mobile offline profile but that simply has download related data in its data filter.

Step Four – Add users to a mobile offline profile.

Once you have created the profile you then add the users who should get this profile.

Step Five – Publish a mobile offline profile.

The final stage is to publish the mobile profile.

Because you will have published a new mobile profile the users will need to exit the mobile application and opt to download changes when it re-loads.

Synchronization Conflicts

In my scenario, the sales people owned the accounts and were the pretty much the only users who would directly edit the account data. But in other scenarios synchronization conflicts are possible. Say a user upadtes the phone num,b er on an account whilst offline. But when the data is taken online You can enable conflict detection in the system settings.

If a conflict occurs then the change will be logged as a sync error. These can be viewed from within the mobile application or in the web client. If required you can then use the RETRY CHANGES button to force the update.

Clicking RETRY CHANGES will load the offending record. The field that is in conflict will be highlighted with an orange exclamation mark. If you would like to keep this change then it can be saved and the sync conflict will be updated to have a status of “Fixed”.

Challenges!

I mentioned in my introduction that I faced a few challenges. Some of these challenges might have been specific to my organisation but I hope listing them here may give you some pointers should you hit similar issues.

Provisioning Issues

Twice I found that I had problems with provisioning. Part way into the provisioning it just stuck and after waiting at least 24 hours it still hadn’t progressed. Initially I think this was because I’d tried to enable the previous version of mobile offline and failed. Later it happened a second time. (Possibly due to user error!) When you make changes to your mobile offline profile you simply make the change and re-publish. However, I de-provisioned instead! And to make it worse I then changed and published my profile whilst the re-provisioning was in progress.

If your provisioning “sticks”, call Microsoft support. They were able to reset it for me. Although this process took a couple of days.

Once the off-line provisioning is working do not select the “de-provision” option. Unless you really want to stop mobile offline. One reason you might want to de-provision is mentioned in the Microsoft technical notes. (Although I suspect it will be a pretty rare reason.) If you wish to change the online region of your CRM organisation you will want to de-provisions and then provision again after the move. So, that any data held in Azure cloud is in the correct online region.

Mobile Offline Profile and CRM Solutions

As described you can only use mobile offline in a production instance. However initially created my offline profile in development and included it in my solution. I just like doing all changes in development. I thought this would be a good idea, even though I couldn’t test it on development. The idea worked until I had made a few changes direct on production that weren’t replicated on development. Somehow, I ended up unable to deploy my managed solution into production. Eventually I decided to only keep my mobile offline profile in production and removed it from my development and pre-production sandboxes.

Testing on Production!

As mentioned in the previous point you cannot test your mobile offline profile on production. I normally have very strict rules on not making any configuration or customization changes directly on production, so this concept did “concern” me.

One concern I had was testing that only the accounts I owned were being shown in the mobile application. As this meant I needed to own some accounts in production. Also, when I wanted to test out the implications of sync conflicts I had to alter data directly in production. I admit to being a purest when it comes to the divisions between development, pre-production and production environments. So doing these things directly on production didn’t sit well with me!

But one tip is to make creative use of the clone option. It is possible to clone a mobile offline profile. So, you can clone the current version of you profile. The cloned profile will contain no users. You can now edit, publish and test the cloned profile. And only when you are happy remove the users from the original profile and add them into the new profile. (Not forgetting to publish the old and new profiles after the users have been moved across.) Obviously, you will still be testing on production but at least you minimize any impact on existing users.

Views That Didn’t Display

I found that views will not display offline if they contain any references to related entities that aren’t included in your mobile offline profile. This wasn’t a great issue but I did find I need to make some small alterations to a few views.

I also found an issue when displaying the stage name for my business process flow in a view. (Something I often did.) I couldn’t directly display the stage name in the view. I eventually created a workflow that when called from my business process flow would set the stage name into a text field. I then showed that in the views instead.

Editable Grids Didn’t Work

I found that editable grids would not display in the mobile client whilst offline. In my case this wasn’t a large issue and I simply disabled the editable grids for the tablet app. If this had been a larger issue I would have considered using some JavaScript to hide / show different subgrids depending on the user currently being online or offline.

One tip here might be to use a getClientState command which will enable you to know if the client is currently online or offline.

var clientState = Xrm.Page.context.client.getClientState(); // *** Returns Online or Offline

Additionally, another command that might be useful is getClient. So you can check if the form is being run in the web client or mobile client.

var client = Xrm.Page.context.client.getClient(); // *** Returns Browser, Outlook or Mobile

Please don’t be put off by the challenges I have described, mobile offline is a great feature and really worth the effort to investigate. My users are very happy with it and that means I am VERY happy with it. J

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s