Fetch Zoho CRM Contact using Deluge
I thought I would pass this along to anyone trying to do what I'm doing. It wasn't working until I contacted support. They had to make some kind of "optimization" on the back end, so your results may vary.
Goal
Prepopulate a form containing user profile information that is auto-filled from the corresponding Zoho CRM record based on the email address. Also leverage the Zoho CRM field so the profile can be linked directly back to the CRM contact.
Method
Use searchRecordsByPDC() to locate the CRM contact by their email address (i.e. zoho.loginuserid).
Solution
In the Form Action > On Add > On Load, I have this script:
ContactRecord = zoho.crm.searchRecordsByPDC("Contacts", "email", zoho.loginuserid);
// Note that you must provide both ID and Full Name for this to work...
input.Zoho_CRM = ContactRecord.get(0).get("Full Name");
input.Zoho_CRM_ID = ContactRecord.get(0).get("CONTACTID");
// ---
input.Last_Name = ContactRecord.get(0).get("Last Name");
input.First_Name = ContactRecord.get(0).get("First Name");
input.Phone = ContactRecord.get(0).get("Phone");
Results
see attached
Cheers,
Jeff