Closed CRFL6372 closed 1 week ago
@CRFL6372 Please draft a mail to support@zohocrm.com. We will follow up on this request over there. Thanks!
Will do, raja. I have also found that the commonality between affected records is that they were created in CRM using a Wizard.
It seems something about their structure is not being properly handled by the SDK.
When using RecordOperations.search_records() to retrieve records by criteria, we encounter a TypeError on approximately 5-10% of records. The error traceback indicates an issue converting a dict to an int within the json_converter.py of the SDK:
Steps:
RecordOperations.search_records()
with a search criteria.Observed Behavior:
The API response unexpectedly includes a
dict
where anint
or other simple type is expected.Expected Behavior:
API response should consistently return expected data types across all records of a given module.
Environment:
Additional Notes:
Searching records by criteria works fine in the old version of the SDK. The records which cause conflict here (in my example below) are perfectly retrieved by the old version using
search_records_by_criteria
. In all honestly I feel that the old version is less problematic and has a much more straightforward design all around.My example, with snippets and traceback:
Two records in our "Deals" module. They each have a unique value for a field called "Acuity Code".
Below are identical tests for each record using
search_records
. Implementation of search_records simply returns the first record object found:ZohoRecord.get_record_from_certificate
Testing Records:
Note: Both records with the specified critiera 100% exist in CRM and, as I mentioned before, are perfectly retrieved by the old SDK.
test.py
Output
Note that the first record is retrieved, and it's ID printed, but the search_records response for the second record fails despite the arguments being of the same type, and both records existing equally in CRM.