Showing posts with label Microsoft Dynamics CRM MoCA - Mobile Compatible development tips. Show all posts
Showing posts with label Microsoft Dynamics CRM MoCA - Mobile Compatible development tips. Show all posts

Friday, 9 June 2017

Mobile compatible development - disable all fields using JS - Microsoft Dynamics CRM - MoCA_Tip#3


Hello All,

Lets go though a quick tip on best practice around disabling all fields using JavaScript in MoCA.

Issue:
In traditional CRM JS development, we tend to use  getDisabled function to identify whether a control is disabled or not and setDisabled to enable or disable a field.

But in MoCA there are some controls which do not expose the above functions which result in JS error(not defined or not found).

Fix:
Before calling the function validate whether the function exist or not  and then call the same. By this way we can avoid unnecessary chaos in our JS.

Code Snippet:

if (control && control.getDisabled && !control.getDisabled()) {
   control.setDisabled(true);
}


Refer this blog for MoCA compatible disable all fields script

Don't forget to go through previous tips if you have missed,
  1. Form Selector and its usage

Tuesday, 4 April 2017

Mobile compatible development - Microsoft Dynamics CRM - MoCA_Tip#1


After the release MoCA, I was interested in exploring the functionalities available and I am happy with the available features.

Now, we are going to see some tips based on my previous experience with MoCA. I will try to provide some more tips in upcoming blog posts,

Behavior of hidden tabs
  • ·        CRM web forms ignore hidden tabs when they are loaded in Mobile. Therefore, if you have any logic based on hidden section fields then those logics are going to break.
  • ·        Make sure the tab is visible on form. Then hide the same using JavaScript, this will make the tab and fields available on form.


Error with field's customized event – Random errors on specific forms
  • ·        This error is common on the forms, which contains multiple tabs/sections/fields, and the errors are random and not specific to any functionality.
  • ·        This is because, we have limits on the count of controls available on mobile form and these are configurable in orgsettings


The default and max allowed items for a mobile form is as follows,

Setting
Default Value
Max Value
TabletClientMaxFields
75
500
TabletClientMaxLists
10
50
TabletClientMaxTabs
5
50