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).
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.
Refer this blog for MoCA compatible disable all fields script
Don't forget to go through previous tips if you have missed,