beforeUpdate(params)

Description

Defines the function that is executed before a bundle in a target account is updated.

Calls to scheduled scripts are not supported.

Returns

void

Since

2016.1

Parameters
Note:

The params parameter is a JavaScript object. It is automatically passed to the script entry point by NetSuite.

Parameter

Type

Description

Since

params.fromVersion

string

The version of the bundle that is currently installed in the target account.

2016.1

params.toVersion

string

The new version of the bundle that is being installed in the target account.

2016.1

Warning:

Before the Before Update script is run, the bundle update process checks for custom objects and files that are present in the previous bundle version but are no longer present in the new bundle version. Then, the bundle update process deletes such custom objects and files from the previous bundle version in a target account.

However, in case the Before Update script stops on any failed condition, the bundle update process stops the bundle update and the user is left with the previous bundle version, where the bundle update process has already deleted some custom objects and files, so the bundle may not be functioning correctly anymore.

You should not remove unused custom objects and files from the new bundle version. You should remove such objects from the new bundle only after your whole install base is upgraded to the new bundle version.

Related Topics

General Notices