Tricks to Resolve Common Scripting Errors on Dynamics CRM Mobile Forms

By | August 16, 2016

Introduction:

There are some common mistakes which we do while scripting which forms an error on Dynamics CRM mobile forms. For instance, while adding ribbon buttons on the form there are possibilities of mistakes made by us which does not form an error on Web form but we can get an error on Mobile form.

In this blog we will see some common errors that we may get on Dynamics CRM mobile app forms and will see the possible cause of these errors and solution for the same based on our observations.

1. There was an error with this field’s customized event.

Error: scope[scopeSplit[scopeSplit.length – 1]].apply is not a function. 

You may see this error when you open any entity record through Dynamics CRM mobile app. Below screen shot shows the error. From the error details, it becomes very difficult to understand the error.Dynamics CRM mobile form

If you open same record from web you will not see this error.

Cause:

It is possible that you have defined incorrect function name for example NaN while adding action on command of the ribbon button for common java script library which you want to use as a reference( like JQuery, Json, XrmServiceToolkit etc.).

This error still occurs even if your button is not visible on that form. Since you have added a reference of script web resource on ribbon, when form loads this reference gets executed and due to incorrect function name, an error gets prompted.

Solution:

Make sure you have added correct function name for these libraries. We should add isNaN as a function name while adding reference scripts like jquery, json, XrmServiceToolkit as an action.Dynamics CRM mobile app forms2. Also it might be possible that you will get an error because of syntactical mistakes done in java script code.

Error: There was an error with this field’s customized event.

Error: Script Error

Sometimes we face an issue on mobile saying Script Error. This issue was not there on Web still we face this on mobile as shown in below screenshot.mobile form

Cause:

It might be possible that you have added script web resources on Dynamics CRM forms and while coding you have done minor mistakes. Some syntax related mistakes might not cause any issue on web but they can cause an issue on Dynamics CRM mobile app (Mobile Forms).

Solution:

Make sure that you have not done any mistake while doing code. This mistake could be function not ended with “;”, addition of an extra “,” in an array, etc. Also make sure that you are doing all possible null/undefined value checking.

So basically, you have to review all scripts that you have added on your Dynamics CRM forms and need to make sure that code does not contain any syntax errors.

Conclusion:

If you are facing any errors on Dynamics CRM mobile forms, it is recommended to review ribbon customization, Dynamics CRM forms, and javascript web resources to check if there is any mistakes in the code.

Access Maps from withing Dynamics CRM mobile App…..Now possible.

Leave a Reply