One of the ways to have this done is to define a session object on the Before Submit script using the setSetting method of nlobjContext. The After Submit script will get the value of this session object using the getSettingMethod.
Sample Code snippets:
Before Submit
function beforesubmit(type)
{
nlapiGetContext().setSetting('SESSION','testsessionobject','test value');
}
After Submit
function aftersubmit(type)
{
var testparam = nlapiGetContext().getSetting('SESSION', 'testsessionobject');
nlapiLogExecution('debug','test param',testparam);
}
Please refer to the Help Guide for the complete information on how to use nlobjContext as well as its methods such as getSetting and setSetting. From the Help Guide sidebar, just navigate to SuiteCloud (Customization, Scripting, and WebServices) > SuiteScript > SuiteScript API > SuiteScript Objects > Standard Objects.
No comments:
Post a Comment