<@U99D069RB> one option is to add it to the global...
# suitescript
j
@devread one option is to add it to the global
window
object another is to declare your variable in a closure shared by both functions e.g. in ss2
Copy code
define(... , function( ... ) {
  var shared;

  function pageInit(ctx) {
    shared = 'hello';
  }

  function saveRecord(ctx) {
    console.log(shared);
    return true;
  }

  return {
    pageInit: pageInit,
    saveRecord: saveRecord
  };
});