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 |
Parameters
The params
parameter is a JavaScript object. It's automatically passed to the script entry point by NetSuite.
Parameter |
Type |
Description |
Since |
---|---|---|---|
|
string |
The version of the bundle that's currently installed in the target account. |
2016.1 |
|
string |
The new version of the bundle that's being installed in the target account. |
2016.1 |
Before the beforeUpdate entry point function runs, the bundle update process checks for custom objects and files that were in the previous bundle version but aren't in the new one. Then, the bundle update process deletes those custom objects and files from the previous version in the target account.
However, in case the beforeUpdate entry point function 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 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.