NB: this blog post is no longer relevant as API v2 lets you use searchRecords with multiple criteria :)
I discovered something really cool tucked away in the Zoho CRM forums today. For the history, check out this thread. In summary, the searchRecords API task in Zoho CRM is impossible to use if you have multiple criteria and in general it's pretty annoying to get the single criterion right. In the forum thread, Zoho Support advised that you can actually use getRecords with a view name. This feature is not documented on the getRecords page at all but I can confirm it works:D
This is really, really cool. It's going to make my life as a Zoho dev much easier! Instead of having to do something really inefficient and ugly like:
I can just create a view called 'ClientWebsite leads in last 3 days' with relevant criteria, copy the cvid from the URL (there will be a number at the end of the URL when you're looking at the list view) and do:
If you've struggled with cludgey searchRecords tasks in the past, you're going to love this trick:D
I discovered something really cool tucked away in the Zoho CRM forums today. For the history, check out this thread. In summary, the searchRecords API task in Zoho CRM is impossible to use if you have multiple criteria and in general it's pretty annoying to get the single criterion right. In the forum thread, Zoho Support advised that you can actually use getRecords with a view name. This feature is not documented on the getRecords page at all but I can confirm it works:D
This is really, really cool. It's going to make my life as a Zoho dev much easier! Instead of having to do something really inefficient and ugly like:
leadRecords = zoho.crm.searchRecords("Leads","(Created Time|<|" + yesterday_date +")",fromIndex,toIndex);for each ele in leadRecords{lead_source = ele.get("Lead Source");createTime=(ele.get("Created Time")).toDate();info "Found lead with create time: " + createTime;dayDiff=days360(createTime,yesterday_date);if(dayDiff <= 2 && lead_source == "ClientWebsite.com.au")
I can just create a view called 'ClientWebsite leads in last 3 days' with relevant criteria, copy the cvid from the URL (there will be a number at the end of the URL when you're looking at the list view) and do:
leadRecords = zoho.crm.getRecords("Leads", 1, 200, { "cvid": 12421421412 });
If you've struggled with cludgey searchRecords tasks in the past, you're going to love this trick:D
Awesome tip, thank you!
ReplyDeleteSo how do i use this with C#.
ReplyDeleteI have tried https://crm.zoho.com/crm/private/xml/Accounts/getRecords(mycustome)
but i keep getting errors back
It only works with Deluge. The API method doesn't work unfortunately.
Delete