SuiteScript 2.x Bundle Installation Script Reference

A bundle installation script's functions are executed automatically during bundle installation, update, or uninstallation, based on one or more of the following triggers:

A bundle installation script file should include a function for at least one of these triggers. If you are using more than one of these, they should all be in the same script file.

The following are example uses for bundle installation script triggered functions:

Two specialized parameters are available to functions in bundle installation scripts, to return the version of bundles, as specified on the Bundle Basics page of the Bundle Builder.

A bundle installation script file can include calls to functions in other script files, if those files are added as library script files on the script record. Any .js files for library script files are automatically included in the bundle when it is added to target accounts.

Bundle installation scripts can call scheduled scripts, but only in the After Install and After Update functions. Calls to scheduled scripts are not supported in the Before Install, Before Update, and Before Uninstall functions.

Bundle installation scripts are governed by a maximum of 10,000 units per execution.

You can create multiple deployments for each bundle installation script, with different parameters for each, but only one deployment can be associated with each bundle. When you associate a bundle installation script with a bundle, you select a specific script deployment.

Bundle installation scripts need to be executed with administrator privileges, so the Execute as Role field should always be set to Administrator on the script deployment record.

Bundle installation scripts can only be run in target accounts if the Status is set to Released. The Status should be set to Testing if you want to debug the script.

Any bundle installation script failure terminates bundle installation, update, or uninstallation.

Bundle installation scripts can include their own error handling, in addition to errors thrown by SuiteBundler and SuiteScript. An error thrown by a bundle installation script returns an error code of “Installation Error”, followed by the text defined by the script author.

Related Topics

Setting Up a Bundle Installation Script
SuiteScript 2.x Bundle Installation Script Type
SuiteScript 2.x Bundle Installation Script Entry Points

General Notices