I'm creating a Map/Reduce script and in the map() ...
# suitescript
t
I'm creating a Map/Reduce script and in the map() step, I am trying to use record.submitFields(), but when the script ends, the value is never actually submitted. Am I not able to use a submitFields call in the map() section of a Map/Reduce script, or is something else going wrong?
b
record.submitFields is perfectly valid in map
you might want to check that there are no errors in the summarize step
t
I'm still fairly new with MRs so I didn't know about the summarize step - I will log the results and see what happens. Tahnks @battk
b
keep in mind, you have to use the various summary objects contained within the context to properly log things
t
Seems like I may have to go back to the docs on this one
s
the above are some reasons I still prefer Scheduled scripts over MR unless we really need the parallel execution of MR.
t
I ended up switching to a Scheduled Script as I was having no luck with the MR. Still not sure what the issue was as the Summary step wasn't printing out any errors and all the logs made it seem like the information was correct. The scheduled script ran just fine, but I had to run it a couple times due to governance issues, which was the reason I decided to go with a MR in the first place, but it was a one-time script anyways so it worked out in the end
b
what code were you using to log
t
I can't remember off the top of my head, but I pulled it from one of the NetSuite docs. It was logging the summary parameter and essentially just showed me the time it took to ran and the amount of key/value pairs, but nothing else
b
that doesn't quite sound right
you need to use the iterator
s
MR as a concept - great MR script type in NS? meh.