With the new CRM for Phones and Tablets mobile app introduced for 2015 Online 1 and 2016, we had a requirement to extend CRM using this new feature.
One nasty thing that I encountered was script errors popping up on form load only on the app and not on the web form.
As you can see from the screenshot, the error does not show what field is causing the error. This was taken from my Samsung Note 3. But interestingly, when I then tried it on an iPhone 6, the error message actually displays field name as well which turned out to be ‘isrevenuesystemcalculated’ – Revenue.
Since we had a lot of form script customisation on this form (Opportunity), my initial thought was that there was something wrong with my code.
Since there is a way to debug my code on the mobile app, I followed Microsoft’s article on troubleshooting.
None of these were able to resolve my problem.
I had made sure that ‘Available on phone’ was checked on the field as well as the section and tab, but that still didn’t fix the issue.
I then realised that the app has a limitation of:
- 75 fields
- 10 Grids
- 5 Tabs
Cause of Issue
The way the app works is that it will load only 75 fields on the form for performance reasons. The first 75 fields are loaded regardless of whether they are visible or hidden. So if your field is not placed in a section of the first 75 fields, then it WILL NOT BE LOADED!
I scrolled across the Opportunity form and confirmed that this was the case:
Since my Revenue field was on the form as a hidden field and placed somewhere way down on a section near the bottom of the form, it was obviously not loaded as part of the first 75 fields.
It turns out that Revenue is a system required field for Opportunity on form load, and so the form threw an error as it thought that it was not loaded.
You will ALSO get this error if you have some Jscript that references a field that is not part of the 75 fields on form load.
I just moved Revenue to the first section which was part of the first 75 fields loaded, and that seemed to have fixed it!
So whenever you are using form scripting that references fields on the form for Dynamics CRM mobile app, always keep in mind that the 75 limitation and the placement of fields matter!