I'm experienced in Suitescript 1.0 but need to use the new SFTP functionality.
I'd like to share the same constant variables across two or more javascript source routines.
In Suitescript 1.0 I used to put them in a library and attach it to the required scripts.
With Suitescript 2.0 I know this is not possible due to modules and the model it uses.
What is the best method to share the variables across multiple Suitescript 2.0 javascript routines?
There are two approaches I can think of.
1) Create your own 2.0 module that contain the constants you want to carry across multiple 2.0 scripts. Then require the new constant module in each of those scripts.
2) Create company level parameters that each of the script reads to obtain the constants. This can be a parameter per or one parameter in a JSON blob to create multiple properties in one parameter.
Either way should get you were your going.