Question: Can we make a map/reduce script return v...
# general
s
Question: Can we make a map/reduce script return value to the script that calls it ? Scenerio : I've a suitelet that calls a lib file for some process and that lib file returns back a value to suitelet to write on the screen. Now , while executing the lib file, there is api usage limit exceed error thrown. So , I wanted the lib file part to be made into a map reduce which returns the value back to suitelet (as the lib file did), that the suitelet can write on the screen.. Also you can suggest an alternate workaround for my case.! Kindly advice !
e
The MR script is not guaranteed to run at the exact moment when you trigger it so by the time it is done with the result, your suitelet will have timed out.
👍 1
m
MR is asynchronous, it doesn’t return a value directly to the script that initiated it You can create a custom record that will hold the value that you want to return. At the end of the MR execution, you can store the result in the custom record. The suitelet can then retrieve the result by querying the record
👍 1
m
I've done this with a client script that polls a suitelet for the Map/Reduce progress and displays a progress indicator
👍 1