how to load a saved search and know its type in su...
# ask-stanley-ai
n
how to load a saved search and know its type in suitescript netsuite
c
AI generated answer (using internal Slack threads):
To load a saved search and know its type in SuiteScript, you need to use the
search.load
method and specify the
type
parameter. This is especially necessary when dealing with custom records or when NetSuite API can't determine the search type. Here is an example of how you can load a saved search:
Copy code
javascript
var searchObj = search.load({id: 'your_search_id', type: 'your_search_type'});
In the above code, replace
'your_search_id'
with the ID of your saved search and
'your_search_type'
with the type of your saved search. If you don't know the type of your saved search, you can find it in the NetSuite UI. For native types, you can refer to the NetSuite Help Center documentation. For custom types, navigate to Customization > Lists, Records, & Fields > Record Types in the NetSuite UI. The ID listed there is the type you want. If your saved search type is a report, unfortunately, SuiteScript does not support reports. You might need to rebuild it as a saved search or use an analytics workbook instead. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842746794
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834698915
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834066749
Please provide your feedback on this answer.