run(scriptContext)

Description

Defines what is executed when the script is specified to be run by the SDF deployment (in the deploy.xml file of a SuiteCloud project).

Returns

void

Since

2015.2

Parameters

Note:

The scriptContext parameter is a JavaScript object.

Parameter

Type

Description

Since

fromVersion

string

The version of the SuiteApp currently installed on the account.

Specify Null if this is a new installation.

2015.2

toVersion

string

The version of the SuiteApp that will be installed on the account.

2015.2

For examples of the run entry point, see SDF Installation Script Samples.

You can also define custom script parameters by adding a parameter to the script record (defined as a custom script field) and setting the parameter to a particular value on the deployment. The following code example shows how to retrieve a script parameter from within an SDF installation script:

            /**
 * @NApiVersion 2.0
 * @NScriptType SDFInstallationScript
 */

define(['N/runtime'], function(runtime) {
    function run(params) {
        var customParam = runtime.getCurrentScript().getParameter({name: 'custscript1'});
    }
    return {
        run: run
    };
}); 

          

See Creating Script Parameters (Custom Fields) for more information about script parameters. See SDF Installation Script Example of Customizing a SuiteApp Update for an example.

Related Topics

General Notices