Is there a way to set a script parameter with code...
# suitescript
a
Is there a way to set a script parameter with code rather the the UI?
s
It is undocumented (and hence may break at any time) but I am saving the last run date for a script to a script param with:
Copy code
record.submitFields({
      id: deploymentInternalId,
      type: record.Type.SCRIPT_DEPLOYMENT,
      values: {
        "custscript_interco_je_last_run_date": format.format({type: format.Type.DATETIME, value: runDate.toDate()}),
      },
    })
l
as an alternative, you could use custom records. Also, i dont know what is your use case, but since you are trying to have some dynamic parameter to your script, it might be an option to use the sessionObj from RUNTIME module, each user can have their own session which can be retrieved from both client and server scripts, sessionObj = runtime.getCurrentSession(); sessionObj.set({name: "myKey", value: "myValue"});
a
@stalbert @lleclerc Thanks guys! 👍