How Can You Search For Nested or Non-Queryable Field Values?

Even though the NetSuite APIs do have some limitations around which fields can be queried, we identified this work-around.

You can create a Saved Search in NetSuite and then reference the savedSearchId in your query. For example with a custbody field where the data/value is stored in the array customFieldList: {customField: [] it cannot be directly queried through the NetSuite APIs.

  1. Access NetSuite, hover over Reports, and click New Search.
  2. Select Transaction.
  3. Add these filers:
    • Type -> is Invoice
    • custbody field name -> is 'value' (in this case the string value in my custbody field is the word "Terminator")
  1. Click Create Saved Search, enter  a Search Title, and then save the search filter.
  2. Hover over Reports -> Saved Searches -> and select All Saved Searches. Note the Internal ID of your new search (e.g. 734).
  3. Using Cloud Elements make a GET /invoices request where savedSearchId = 734.
  4. Confirm that your desired invoices are present in the results based on the value defined in your NetSuite saved search.

Note that when you query based on savedSearchId you cannot append any additional qualifiers in the Where clause (such as tranId='INV00000001') so this workaround will not be successful for all use cases, but it does provide one option to get around the NetSuite query limitations.

Please note that when using savedSearchId, our platform makes use of TransactionSearchAdvanced in NetSuite. When using this feature you will need to make sure you are hitting the endpoint of the transactional object you are querying. For example, GET /invoices?where=savedSearchId='123' would invoke TransactionSearchAdvanced to accomplish this query.