Has anyone loaded 2 saved searches (of disparate r...
# suitescript
m
Has anyone loaded 2 saved searches (of disparate record types) in the getInputData entry point of a Map Reduce Script? I need to load a transaction search and a custom record search. I'm having a hard time conceptualizing what will get passed to Map. Any guidance is greatly appreciated!
e
You would need to do each search and then combine the results into an array and then return that. That array with the results will get passed into the map.
s
or if you have an actual link, use query and return that from the getInpu
s
or use SuiteQL to possibly combine your 2 searches into 1
s
If the record types are related (parent-child), you may be able to combine them into a single saved search. If not, then the SuiteQL suggestions are likely the better option, as you have more flexibility in join criteria.
n
If you're using one of the searches as a reference, such as item data for a transaction update or bill of material revision creation/update, you can cache the relevant data. There's also the really sloppy kludgey way of shoving it into an object that's included with every element of your array, but I don't recommend that for any scaling solution.