Locking SDF Custom Objects in the SuiteApp Type of SuiteCloud Project
In a SuiteCloud Development Framework (SDF), you can consider an installation preference to lock supported SDF custom object types in your SuiteCloud project when the project is of type SuiteApp. Locking SDF custom objects helps protect an object’s fields from being edited by your SuiteApp users.
Consider the following information when locking SDF custom objects:
-
When an object is successfully locked, the object’s fields cannot be modified in target accounts where the SuiteApp is installed.
-
Locking an object prevents target account users from editing the object.
-
Locking an object does not prevent target account users from seeing the object.
-
The NetSuite pages for locked objects do not show actions that allow changes to the object, such as Edit, Delete, and Change ID. Also, all list and view pages display a lock icon to provide complete visibility of locked objects in installed SuiteApps.
-
For a list of SDF custom object types that can be locked, see Lockable SDF Custom Objects. See the Notes column for information about locking exceptions. Certain objects have different behavior. For example, a small subset of fields can be modified on a locked workflow object.
Even when using only locking preferences without hiding preferences, your SuiteCloud project must include both the locking.xml
and hiding.xml
files for the project to successfully deploy to a target account.
To lock SDF custom objects in a SuiteCloud project of SuiteApp type
-
Create a
locking.xml
file in theInstallationPreferences
folder of your SuiteCloud project of SuiteApp type. To create the file using a SuiteCloud IDE, see Creating an Installation Preference File with SuiteCloud IDE Plug-in for WebStorm. If you already have alocking.xml
file in your SuiteCloud project, proceed directly to the next step. -
In the
locking.xml
file in your SuiteCloud project, enter values for the following attributes and fields:-
For the
type
attribute of the<preference>
element, specify the installation preference type to beLocking
. For more information about installation preferences, see Installation Preferences in the SuiteApp of SuiteCloud Project. -
For the
defaultAction
attribute of the<preference>
element, specify a default locking action for all SDF custom objects in your SuiteCloud project. Supported values for an action areLOCK
andUNLOCK
.Setting a value for the default action can reduce the steps when applying a preference to many objects at a time. The default action applies to SDF custom objects in your project that are not in the apply action list of your
locking.xml
file. In the included example, the installation locking preference for lockable SDF custom objects in the SuiteApp project isUNLOCK
, so all SDF custom objects in the SuiteApp other than customlist_example1 are unlocked. -
For the
action
attribute of the<apply>
element, specify a value that will apply to the SDF custom objects. Valid values areLOCK
andUNLOCK
. For example,<apply action="LOCK">
locks the specified SDF custom object types. -
For the
<object>
element, specify the script ID of the SDF custom object that is being locked. For example,<object>customlist_example1</object>
. For additional SDF custom objects, you can add<object></object>
elements as needed. For the list of lockable SDF custom object types, see Lockable SDF Custom Objects.
-
-
Save your changes in the
locking.xml
file.When you later deploy the SuiteCloud project, to enable the values specified in the
locking.xml
file, you must select the Apply Installation Preferences box. For more information about selecting that preference during deployment, see Applying Installation Preferences During SuiteCloud Project Validation and Deployment.
Locking a Custom Object using SDF Example
The following XML sample is an example of locking preference in a locking.xml
file in a SuiteCloud project of SuiteApp type. The example locks the customlist_example1 SDF custom object, sets the preference type to LOCKING, sets the default action to UNLOCK, sets the apply action to LOCK, and adds the object:
<preference type="LOCKING" defaultAction="UNLOCK">
<apply action="LOCK">
<object>customlist_example1</object>
</apply></preference>
Lockable SDF Custom Objects
The following table lists the SDF custom object types that you can lock in the SuiteApp type of SuiteCloud project. The effects of locking vary according to object type.
Object Type |
Notes |
---|---|
customlist |
|
customrecordtype |
|
customsegment |
|
Fields:
|
|
Forms:
|
|
Plug-ins:
|
|
plugintype |
— |
plugintypeimpl |
— |
role |
|
savedsearch |
|
scripts:
|
|
SSP applications |
|
Workflows |
Workflow objects are partially editable.
|
translationcollection |
When an SDF SuiteApp deployment locks a Translation Collection in the target account, subsequent deployments can still update that Translation Collection including its strings. |
customtransactiontype |
Values cannot be added, edited, or deleted in locked custom transaction |
Related Topics
- Installation Preferences in the SuiteApp of SuiteCloud Project
- Default Installation Preferences
- Hiding Files in the SuiteApp Type of SuiteCloud Project
- Locking Files in the SuiteApp Type of SuiteCloud Project
- Overwrite Settings for SuiteApp Projects
- Applying Installation Preferences During SuiteCloud Project Validation and Deployment
- Installation Preferences Validation in SuiteCloud Projects
- Installation Preference File Structure in SuiteCloud Projects