You can define global variables in a Map/Reduce sc...
# suitescript
s
You can define global variables in a Map/Reduce script, however any changes made to those variables in one execution phase will not be visible to any others, which makes them less useful, except for defining static constants. You can make use of the
N/cache
module to maintain a set of values across multiple executions, though, but you need a mechanism for re-populating the values when the cache expires or is invalidated, so it is best if the values are persisted to a record or can be re-calculated.