Overwrite Settings for SuiteApp Projects
When an SDF SuiteApp is updated (or a SuiteApp project deployed), your installation preferences configuration specifies how to preserve some or all of the existing data in the target account for script deployments, custom record types, and custom lists. Preserving data can be useful when you do not want to overwrite things your SuiteApp users have modified in the target account, such as script deployments, custom record instances, or custom list values.
You can configure SDF SuiteApp installation preferences in SuiteCloud Development Framework (SDF) by editing the code block <preference type="OVERWRITING">
in the overwriting.xml
file, which is located in the InstallationPreferences
folder of your SuiteApp project.
The overwriting.xml
file is not required in the SuiteApp project, so you can still validate and deploy your SuiteApp project when there are no overwriting installation preferences configured for it.
When you deploy the project, enable the Apply Installation Preferences option to apply the settings in the overwriting.xml file.
The following information describes the fields you can set for SDF SuiteApp overwriting installation preferences:
Overwriting Script Deployments
For script deployments, you can set script deployment default preferences for the scriptdeployments
field, and individual script deployment preferences for the scriptdeployment
field.
For the scriptdeployments
field, you can set the defaultAction
attribute to OVERWRITE
or PRESERVE
. This setting is the default applied to all script deployments that are not explicitly set by the scriptdeployment
field’s action
attribute.
For the scriptdeployment
field, you can set the action
attribute to OVERWRITE
or PRESERVE
. This setting applies to an individually specified script deployment.
When a script deployment already exists in the target account, specifying OVERWRITE
overwrites it with the one from your SuiteApp, and specifying PRESERVE
retains the account version of the script deployment instead of the one from your SuiteApp.
The scriptid attribute must follow the pattern as customscript_{parent_scriptid}.customdeploy_{scriptdeployment_scriptid}
, where {parent_scriptid} is the script ID for the script SDF custom object that contains the script deployment, and {scriptdeployment_scriptid} is the script ID for the script deployment itself.
The following code sample configures an SDF SuiteApp’s installation preferences to overwrite all script deployments of the SuiteApp in the target account by default, with the exception to preserve the script deployment customscript_user_event_example.customdeploy_ue_example
:
<scriptdeployments defaultAction="OVERWRITE">
<scriptdeployment scriptid="customscript_user_event_example.customdeploy_ue_example" action="PRESERVE"/>
</scriptdeployments>
In the preceding code sample, all of the script deployments that belong to other objects in the SuiteApp are also overwritten in the target account, not only the script deployments that belong to customscript_user_event_example
.
For more information about script deployments, see Script Deployment.
Overwriting Custom Record Types
For custom record types, you can set instance default preferences for the instances
field, and individual instance preferences for the instance
field.
For the instances
field, you can set the defaultAction
attribute to OVERWRITE
or PRESERVE
. This setting is the default applied to all custom record instances that are not explicitly set by the instance
field’s action
attribute.
For the instance
field, you can set the action
attribute to OVERWRITE
or PRESERVE
. This setting applies to an individually specified custom record type instance.
The following code sample configures an SDF SuiteApp’s installation preferences to preserve all of the instances for custom record type customrecord_type_example
in the target account by default, except for the instance customrecord_instance_example
which will be overwritten:
<customrecordtypes>
<customrecordtype scriptid="customrecord_type_example">
<instances defaultAction="PRESERVE">
<instance scriptid="customrecord_instance_example" action="OVERWRITE"/>
</instances>
</customrecordtype>
</customrecordtypes>
For more information about custom record types, see the following topics:
Overwriting Custom Lists
For custom lists, you can set custom value default preferences for the customvalues
field, and individual custom value preferences for the customvalue
field.
For the customvalues
field, you can set the defaultAction
attribute to OVERWRITE
or PRESERVE
. This setting is the default applied to all custom list values that are not explicitly set by the customvalue
field’s action
attribute.
For the customvalue
field, you can set the action
attribute to OVERWRITE
or PRESERVE
. This setting applies to an individually specified list value.
The following code sample configures an SDF SuiteApp’s installation preferences to overwrite all of customlist_example
custom list’s values in the target account by default, except for the customlist_value_example
value which will be preserved:
<customlists>
<customlist scriptid="customlist_example">
<customvalues defaultAction="OVERWRITE">
<customvalue scriptid="customlist_value_example" action="PRESERVE"/>
</customvalues>
</customlist>
</customlists>
For more information about custom lists, see the following topics:
Related Topics
- Installation Preferences in the SuiteApp of SuiteCloud Project
- Default Installation Preferences
- Locking SDF Custom Objects in the SuiteApp Type of SuiteCloud Project
- Hiding Files in the SuiteApp Type of SuiteCloud Project
- Locking Files in the SuiteApp Type of SuiteCloud Project
- Applying Installation Preferences During SuiteCloud Project Validation and Deployment
- Installation Preferences Validation in SuiteCloud Projects
- Installation Preference File Structure in SuiteCloud Projects