SDF Installation Scripts as XML Definitions
You can use SuiteCloud Development Framework (SDF) to create scripts that execute while SuiteApp deployments are installed to a target NetSuite account. These types of scripts are called SuiteScript 2.x SDF installation scripts. You can use SDF installation scripts to customize installation. For example, to do the following tasks on a target NetSuite account:
-
Verify the account and run your own validations.
-
Check for required permissions and features prior to installation. For an example, see SDF Installation Script Example of Validating an Account Preference Before Installation.
-
Stop installation when a requirement is missing in the account.
-
Migrate data that is required by an application. For an example, see SDF Installation Script Example of Customizing a SuiteApp Update.
The SDF installation script records and deployments are represented in SDF as sdfinstallationscript
objects. The SuiteScript files referenced by a sdfinstallationscript
object are stored in the FileCabinet folder.
For SDF installation scripts and SuiteCloud project types:
-
SuiteApp projects only support SDF installation scripts.
-
Account customization projects do not support SDF installation scripts.
To use SDF installation scripts, do the following tasks in your project:
-
In the File Cabinet folder, include a SuiteScript file as a SDF installation script type. For more information about SuiteScript and using this script type, see SuiteScript 2.x SDF Installation Script Type.
-
In the Objects folder, the
sdfinstallationscript
XML object represents the script record. It can also contain deployment records as XML substructures. For information about available fields, see the reference documentation for thesdfinstallationscript
element in SuiteCloud Development Framework XML Reference. -
In the deploy file, include a
run
element andscript
element containing the following:-
a path to script object
-
a reference to the script deployment
For an example, see Deploy File that Runs SDF Installation Script Example. For information about reference format, see Syntax Guidelines and Reference Formats for SDF Custom Objects.
-
From the deploy file, specify when you want the script to run per the order of appearance in the deploy file. For example, by placing your SDF installation script reference at the end of the deploy file, you instruct the script to execute after the SuiteApp is installed. For more information, see Customizing SuiteApp Project Deployment using SDF Installation Scripts.
-
For more information about using SDF installation scripts in a SuiteApp project, see the following topics:
Related Topics
- Scripting
- User Event Scripts as XML Definitions
- Scheduled Scripts as XML Definitions
- Workflows as XML Definitions
- Translation Collections as XML Definitions
- Map/Reduce Script Objects as XML Definitions
- Portlet Scripts as XML Definitions
- Client Scripts as XML Definitions
- Integration Records as XML Definitions
- Mass Update Scripts as XML Definitions
- Suitelet Scripts as XML Definitions
- RESTlet Scripts as XML Definitions
- Secrets as XML Definitions
- Single Page Applications as XML Definitions