hey all, what would be the best way to take a saved search that shows the quantity sold for every active inventory item (about 7,000 of them), and update a custom field on each inventory item with that quantity sold value? The purpose for this is to sort by best sellers on the website.
I got this to work in SS1.0, but it only handled the top 200 items. I took this into a scheduled script in SS2.0, same thing -- with a loop and records.submitFields(options) I got the top 200, but it won't handle more than that. (my requirements want top 1,000 preferably, or at least 600).
So, a NS tech said to do this: "For what you need to do, you could use just getInputData and map (forget reduce and summarize). You could create your search, run it, and get the ids of the records to work on (get input data). Then Map wouldn’t map at all, it would just update your record using something like N/record submit fields or something similar" So, I ran the saved search in a getInputData function on a Map-Reduce and the results return in the context of the map function, but parsing that seems unusual: results.getValue({name:'quantity', summary:search.Summary.SUM}) and/or results.getValue({name:'islotitem', join:'item', summary:search.Summary.GROUP}) just isn't working like it did in the scheduled script.
Any ideas? Is there just an overall better way to achieve sorting by best sellers than saved searches and SS2.0? Should I just create 5 scripts, each handling just 200 each? Thanks in advance!