beforeUpdate(params)

Description

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

Calls to scheduled scripts aren't supported.

Returns

void

Since

2016.1

beforeUpdate(params) Parameters

Note:

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

Parameter

Type

Description

Since

params.fromVersion

string

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

2016.1

params.toVersion

string

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

2016.1

Warning:

Before beforeUpdate runs, the bundle update process checks for custom objects and files present in the previous version but missing from the new bundle version. Then, the bundle update process deletes those custom objects and files from the previous version in the target account.

However, if the beforeUpdate entry point function stops on any failed condition, the bundle update process stops the bundle update. The user is left with the previous bundle version, where the bundle update process has already deleted some custom objects and files. This means that the bundle may not function correctly anymore.

You shouldn't 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