How to search for related records in Zoho Books?

How to search for related records in Zoho Books?

Hello,

Deluge reference documentation here: https://www.zoho.com/deluge/help/books/fetch-records.html
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"?

  1. // set variables
  2. estimateId = "102235000000XXXXXX";
  3. orgId = "XXXXXXXX";
  4. connection = "zoho books";
  5. // formulate the search as described in the "<search>" section of the linked documentation
  6. search = "estimate_id=" + estimateId;
  7. relatedRecords = zoho.books.getRecords("SalesOrders",orgId,search,connection).get("salesorders");
  8. info relatedRecords.toJsonList().size();
  9. info relatedRecords;
the resulting info log:
  1. 200
  2. {"current_sub_status":"closed","date":"2021-02-26",....
  3. // followed by the details on 200 records that may or may not match my search criteria
  4. Thanks,

Ian Melchior