How to pass one value from one suitescript to anot...
# suitescript
m
How to pass one value from one suitescript to another suitescript?
n
Which script types are you talking about?
m
From suitelet, I have create a suitelet script to authorize and get access token and refresh token, I want to pass both value to another suitelet that refresh the token and get another access token and refresh token
n
Add parameters to the suietelet you are calling and when you call that suitelet provide the parameter values.
m
Using sourcing and filtering?
How the suitelet set the parameter?
n
That makes no sense. Navigate to the suitelet in the UI and add new parameters. Make a note of the ids (you should specify the id's as you create them). You can then use those id's to make a call to the SuiteLet as parameters
Respectfully, you should read up on creating and deploying scripts in NS help as well as looking at the relevant module you are using to call the SuiteLet to understand how to add parameters.
m
Afaik, the suitelet only get not set the parameter
n
You send the parameter values in your POST to the SuiteLet or as url parameters for a GET call...
The calling SuiteLet provides the parameter values (effectively "set") the called suitelet "gets" the parameter values. That's how it works, the values are only good for that one call and not persistent on the script deployment.
e
Could you extract all of the token logic into a custom module, and then have both Suitelets call the relevant functions within the module, rather than trying to call each other? This is typically how I've managed tokens with external APIs previously.
💯 2
👍 1
r
This process is demonstrated using dependencies in my GitHub template. It may help to check this out and establish your connection between scripts this way. Or you can look at script parameters to pass values when you scheduled using the task module. https://github.com/devnetkc/NetSuite-CustomModules-Template