Processing and Installation Script Type Differences

These script types process records or run during installation and deployment.

The following sections compare script types available in both SuiteScript 1.0 and SuiteScript 2.1 and describe those without a SuiteScript 1.0 equivalent:

Bundle Installation Script Type Differences

SuiteScript 2.1 bundle installation scripts use the beforeInstall, afterInstall, beforeUpdate, afterUpdate, and beforeUninstall entry points. These entry points replace the SuiteScript 1.0 bundle installation event functions.

The entry point context provides bundle-version information. The toVersion property is available for installation and update entry points, and the fromVersion property is available for update entry points. Review the applicable entry point API when converting scripts that rely on bundle-version values.

For more information about the bundle installation script type in SuiteScript 2.1, see SuiteScript 2.1 Bundle Installation Script Type.

Note:

SuiteBundler is still supported, but it will not be updated with any new features.

To take advantage of new features for packaging and distributing customizations, you can use the Copy to Account and SuiteCloud Development Framework (SDF) features instead of SuiteBundler.

Copy to Account is an administrator tool that you can use to copy custom objects between your accounts. The tool can copy one custom object at a time, including dependencies and data. For more information, see Copy to Account.

SuiteCloud Development Framework is a development framework that you can use to create SuiteApps from an integrated development environment (IDE) on your local computer. For more information, see SuiteCloud Development Framework.

Map/Reduce Script Type Differences

Map/Reduce scripts have no SuiteScript 1.0 equivalent. They are designed for processing large amounts of data that can be divided into small, independent parts.

A Map/Reduce script can include the following entry points:

  • getInputData

  • map

  • reduce

  • summarize

Use Map/Reduce scripts instead of scheduled scripts when processing large datasets that can benefit from parallel processing and staged execution.

For more information about the map/reduce script type in SuiteScript 2.1, see SuiteScript 2.1 Map/Reduce Script Type.

Mass Update Script Type Differences

Here's how mass update scripts differ between SuiteScript 1.0 and 2.1:

  • In SuiteScript 2.1, a mass update script includes the each entry point. There is no equivalent event type in SuiteScript 1.0.

  • The rec_type and rec_id arguments used in SuiteScript 1.0 mass update scripts correspond to the params.type and params.id properties of the object passed to the each entry point in SuiteScript 2.1.

For more information about the mass update script type in SuiteScript 2.1, see SuiteScript 2.1 Mass Update Script Type.

Scheduled Script Type Differences

Here's how scheduled scripts differ between SuiteScript 1.0 and 2.1:

  • In SuiteScript 2.1, a scheduled script uses the execute entry point. There is no equivalent event type in SuiteScript 1.0.

  • In SuiteScript 1.0, nlapiScheduleScript schedules a script. In SuiteScript 2.1, task.create(options) creates a task.ScheduledScriptTask. Set its scriptId and deploymentId properties, then call ScheduledScriptTask.submit() to submit it.

  • The SuiteScript 1.0 scheduled script function receives a type argument that identifies how the script was invoked. In SuiteScript 2.1, the context object passed to the execute entry point provides this information in its type property.

  • SuiteScript 2.1 scheduled scripts have no direct equivalent for the SuiteScript 1.0 nlapiSetRecoveryPoint() function. After a system failure, a restarted SuiteScript 2.1 scheduled script begins again from the start.

  • SuiteScript 2.1 scheduled scripts have no direct equivalent for the SuiteScript 1.0 nlapiYieldScript() function. They don't support manual yielding. For work that needs yielding, use a Map/Reduce script.

For more information about the scheduled script type in SuiteScript 2.1, see SuiteScript 2.1 Scheduled Script Type.

SDF Installation Script Type Differences

SDF installation scripts have no SuiteScript 1.0 equivalent. The SDF installation script type performs setup, configuration, validation, and data management tasks when an SDF SuiteApp project is deployed to a target account.

For more information about the SDF installation script type in SuiteScript 2.1, see SuiteScript 2.1 SDF Installation Script Type.

Related Topics

General Notices