can i make use of global variable in MR Script any...
# suitescript
d
can i make use of global variable in MR Script any solutions?
d
Using custom module and inject in your scripts.
If use SS1.0, you need create a library to this.
Here a simple sample. With 2.x you just need inject in headers like as well
d
what about MR Script ? can u give me some more additional info
b
standard answer is no global variables for map/reduce scripts
store your data in a custom record and access that custom record through each iteration of your script
d
is it possible for each map, can access and update the custom record
Or can u explain me in small pseudocode for custom record solution
b
make a custom record in your getInputData
pass its id into each member of the array you return
have each map load the custom record and manipulate the data on the custom record
save when done
d
If you want to share info in MR's steps, you need create a custom record, or use a cache module. BUT I need to tell a cache module does not work correctly
If want share a structure of variables, you can use a library/custom module (its a good idea to work in MR cause u have a patterm)
b
forget to mention to keep the concurrency level to 1 if you dont want to code in retry logic for concurrency related issues due to the shared custom record
💯 1