I'm trying to load a saved search with a SuiteScri...
# suitescript
t
I'm trying to load a saved search with a SuiteScript 2.0 Scheduled Script. However, when I try to load and run the search, it returns an error saying "That search or mass update does not exist", even though I see it in the list of public saved searches. Here's the code I'm using:
Copy code
var searchResults = search.load({
    type: search.Type.WAVE,
    id: 'customsearch1676'
}).run().getRange(0, 1000);
s
I don’t think search.Type.WAVE is an available enumeration
t
When I create the search using search.create(), I'm able to use search.Type.WAVE as an enumeration and the search works just fine.
I'm beginning to think that a Wave saved search isn't supported by search.load()
s
the easiest thing to get a loaded search into script is to use the chrome extension “NetSuite Saved Search Code Export”
t
It's not supported for a Wave saved search 😞
s
hmm, perhaps it isn’t scriptable, what is a Wave record exactly?
s
try omitting the
type
property in your
search.load()
?
t
@SuiteBender I'm not entirely sure myself. I know it's a fairly new functionality that NetSuite released, and has to do with managing Pick Tasks, or something along those lines.
@stalbert I had tried that, and the error that came back was "UNABLE_TO_DETERMINE_RECORD_TYPE_FOR_SAVED_SEARCH_ID"
s
I see, it’s part of the WMS, maybe bundle id 314380. If it is a custom transaction maybe try the type: CUSTOM_TRANSACTION
t
I just tried that, and it's coming back as "INVALID_RCRD_TYPE"
s
if you goto an example wave transaction can you post the URL?
s
Hmm.. because it’s a .nl and I don’t have access to the Wave feature in my NetSuite instance, it makes it much harder for me to think-through how to see it in scripting. Without me looking at it, I assume the best approach is to re-create it using search.create() since that works for you. Usually you can find the script equivalent of a field in the UI by selecting one of the formula fields and then choose your field. e.g. “Projected Total” field is really {projectedamount} in script.