Dynamics 365 - mobile offline profile error

 

I have a love/hate relationship with Mobile offline and today it threw an error in one environment that wasn’t occuring in the any of the other environments with the same Mobile offline profile setup.

Exporting Mobile Offline

When you add a mobile offline profile to a solution and export, it will automatically add any entities that are linked by Metadata. In my mobile offline profline, it has 18 entities in the Mobile Offline Profile Item Details.

When you export, it explodes the number of entities in my solution to 108.

adding entities such as

  • Web File Log
  • Blog Post
  • Case
  • Forum Alert
  • Idea
  • IoT Device
  • Phone call

None of those are needed in mobile offline, they exist in the system on Microsoft solutions, why must Microsoft add them to my solution.

There are 18 entities that I choose to be available offline. Dynamics 365 adds any other entities referenced in the metadata. Microsoft say this is by design but the problem is we can’t add all these entities to our solutions because it would increase dependencies and export/import times.

Due to Dynamics 365 automatically added these entities on export, it means you can move the Mobile offline profile between environments and have to manually create them.

Publish error

I manually recreated the Mobile offline profile in each environment and published without error, until today where in one environment, publishing caused this message to appear

The entity ‘account’ in profile ‘Mobile Offline Profile name’ is configured with the filter download related data only, however there are no relationships specified for this entity in profile item associations. If an entity is set to download related data only you must specify a profile item association to this entity

After checking the mobile offline profile was the same. I checked the version of Dynamics

Server version: 9.1.0000.18647Client version: 1.4.838–2005.4

The same in all environments.

Sherlock Hosk time

So why is it complaining about the account

Download related data only?

I read the Microsoft documentation for clues — Set up mobile offline synchronization to allow users to work in offline mode on their mobile device

The page has this text

“Download related data only — Make related data for this entity available offline. If you don’t set any relationships, no records for this entity will be available.”

The page or in Dynamics does it explain what relationships are or importantly how to set them.

In classic Dynamics 365 terms, setting a relationship is linking two entities together, this I need to set what other entities is the account related two by updating the Mobile offline

I assumed I needed to link the account with Mobile Offline profile. Below you can see that the account profile item has no item association.

I add some relationships but I still get the error. Useful the GUI shows what avaiable relationships are available

I then add the item into the Application (opportunity) it worked but when I added the application to account, it did not. I’m not sure of the difference.

Warning if you add the same relationship in both sides you will get a circular error

has a circular reference which will prevent your data download. Please review the circular reference chain: opportunity => account => opportunity and remove the profile item association that causes the circular