Setting Script Parameter Preferences

Note:

The content in this help topic pertains to all versions of SuiteScript. Be aware that currently it may only include links or examples for SuiteScript 1.0.

As a script author, NetSuite gives you the ability to specify the preference type for each script parameter (see figure). Available preference types are:

Setting Script Parameter Preferences page

At the time these three script parameters were created, no preferences were set. In this case, parameter values are defined on the Parameters tab of the Script Deployment record.

Setting Script Parameter Preferences page

Note that users who install a bundled script that uses preferences can override the default behavior of the script and customize the script to their specific business needs. Setting preferences eliminates having to manipulate the script code or the script deployment. (For information about bundling scripts, see the SuiteBundler Overview topic in the NetSuite Help Center.)

Example

In this example, the parameter called Check Box Required (with the internal ID custscript_checkboxtest2 ) is set to the Company preference.

Setting Script Parameter Preferences page

By going to Setup > Company > General Preferences in the Custom Preferences tab (see below), administrators can set the default value of this parameter for the entire company. In this example the value of the Check Box Required script parameter is set to T (the box is checked).

Setting Script Parameter Preferences page

When the Suitelet that contains this box is deployed, the Check Box Required script parameter will appear checked.

Setting Script Parameter Preferences page

If the Check Box Required parameter had been set to F (the box contained no check mark), the box would have appeared empty on the form when the Suitelet was deployed.

Script Parameter Preferences and Bundles

Bundled script parameters that have a user or company preference set are not updated in target accounts when the bundle is updated. However, script parameters that do not have a preference specified are considered part of the script deployment, and whether they are updated in target accounts when the bundle is updated depends on the setting of the related bundle object preference:

If bundle authors expect target account users to want to change parameter values for a bundled script, on the script record they should set the Preference for these parameters to be either Company or User. Target account users can then change parameter values as needed, and these values are not affected on bundle update, even if the related bundle object preference is set to Update Deployments.

To prevent changes to target account script deployment parameters that do not have a preference set, set the related bundle object preference to Do Not Update Deployments.

For more information about bundle object preferences, see Bundle Object Preferences.

General Notices