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.
- Access NetSuite, hover over Reports, and click New Search.
- Select Transaction.
- 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")
- Click Create Saved Search, enter a Search Title, and then save the search filter.
- Hover over Reports -> Saved Searches -> and select All Saved Searches. Note the Internal ID of your new search (e.g. 734).
- Using Cloud Elements make a
GET /invoices
request wheresavedSearchId = 734
. - 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.