This is an article to hopefully resolve for you quicker than it took me, why a zoho.crm.searchRecords() returns some of the records but omits others.
Why?
The use-case was that we were creating a custom related list on a Zoho Finance > Sales Orders module but it wasn't finding all the Quotes related to this Sales Order.
How?
The quick answer is buried in Zoho documentation and due to the searchRecords function requiring it's 5th parameter which defaults to "not converted" records:
<variable>=zoho.crm.searchRecords(<module_name>,<criteria>,<page>,<per_page>,<search_value>,<connection>);
- <variable>=zoho.crm.searchRecords(<module_name>,<criteria>,<page>,<per_page>,<search_value>,<connection>);
The solution:
The long answer/investigation is
- getting a JSON response with a zoho.crm.getRecordByID() with a quote that works and a quote that doesn't
- Comparing both records JSON and finding the $converted system field is different.
- Checking the Zoho documentation for an example showing how you can get all results irrespective of whether they are converted or approved:
- Done. Ta daa!
Source(s):