How to search for related records in Zoho Books?
Hello,
Note: This is in a Zoho Creator function
I'm having some difficulty writing a function in Deluge which will search for related records in Zoho Books. In this case, I am trying to find all Sales Order records that are associated with a certain estimate. However, my function returns 200 records (the max that can be retrieved in one call), rather than the 1 Sales Order that I know is related to the given Estimate ID.
(code below)
What is the correct way to retrieve a list of all sales orders in Zoho Books that have a given value for "estimate_id"?
- // set variables
- estimateId = "102235000000XXXXXX";
- orgId = "XXXXXXXX";
- connection = "zoho books";
- // formulate the search as described in the "<search>" section of the linked documentation
- search = "estimate_id=" + estimateId;
- relatedRecords = zoho.books.getRecords("SalesOrders",orgId,search,connection).get("salesorders");
- info relatedRecords.toJsonList().size();
- info relatedRecords;
the resulting info log:
- 200
- {"current_sub_status":"closed","date":"2021-02-26",....
- // followed by the details on 200 records that may or may not match my search criteria
- Thanks,
Ian Melchior