Concern
Occasionally, CRM users may encounter a common problem with Client Scripts, where a script fails at the ZDK (i.e., Zoho Development Kit) level and is unable to fetch data from CRM modules.
In such situations, users often wonder what steps they can take on their own to resolve the problem. In this post, we will walk through a few troubleshooting steps that you could try from your end and observe the outcome.
The purpose of this post is to explain the scenarios in detail. Also, to raise an awareness about the steps which needs to be taken on customer’s end to troubleshoot this problem and providing a guidance about the information that is required by Zoho to debug further on our end.
Common Errors in Logs/Console
When the user executes a client script, they may face any of the following errors.
Unable to recognise any module (i.e., Leads)
Undefined is not an object (evaluation ‘(await(await ZDK.Apps).CRM).Contacts’)
ZDK.Apps.CRM: undefined
When users type ZDK.Apps.CRM. -- It would not list any CRM modules
Example Code
var leads = ZDK.Apps.CRM.Accounts.fetch();
leads[0].Last_Name;
In the above first line, we use the ZDK method, and it may fail sometimes by throwing any of the above errors, which leads to a complete script logic failure.
Troubleshooting Guide
Let us try the below possible troubleshooting steps to resolve the above errors at the user's end:
Method1: Adding a Dummy Field into Layout
We request the user to add a dummy field into any module's layout and save. This action ensures that the ZDK in backend regenerates and it could resolve the problem instantly.
-> A user can go to any Module (i.e. Contacts) -> Layout in Zoho CRM and add a dummy field (i.e. Single Line), then Save the Layout.
Navigate to Setup (⚙️) in Zoho CRM >> Customization >> Modules & Fields >> Module >> Layout
-> Once the field is added and saved, the layout. Try performing a Hard Refresh of the browser page and check if the Client Script is working fine.
Method2: Changing API name of any field
We request the user to make a temporary API name change in any field (not used primarily) in the module (i.e., Contacts). This action will also regenerate the backend code level changes, and it could resolve the problem at the user's end immediately.
Navigate to Setup (⚙️) in Zoho CRM >> Developer Hub >> APIs and SDKs >> API Names >> Module >> rename API name
Once the above step is completed, try performing a Hard Refresh of the browser page and check if the Client Script is working fine.
We strongly recommend the users to revert the Module / Field API name to previous name to avoid any disruptions in future related to Integration with Zoho or Third Party service or avoid conflicts related to API based integrations.
What we need from Partners:
After performing the above methods, if it still does not work, then we would require to check the exact reason in our backend with logs. We would request you to provide the below information:
Please do not skip any questions.
1. Share the user's CRM Org ID and email address so that we can check the details in our backend.
2. Type the following and confirm if it shows the CRM Module. If yes, select the module and complete the line as per syntax, then check if script works. Share the outcome on this.
Start Typing - ZDK. then selects Apps. then select CRM. then select check if CRM modules listed.
3. Share a Small Recording in which replicate it by executing a script and show the browser console logs.
To check the Browser Console Logs ==> Give a right click on the screen -> Click Inspect -> Choose the Console & Network tabs and check if there are any errors. Ensure to show the full-page recording.
4. Share the complete script as text file and usage in detail for us to understand in better.
5. Share the complete Client Script configuration screenshot – showing Module, Event & Event Type for our better understanding.
6. Since when you are facing the reported problem. Approximate Date & Time would be helpful to validate in our backend logs.
7. Check internally, if there are any recent configration or updates in Zoho CRM - such as: adding Picklist field or new options or any field with special character.