Setting Script Parameter Preferences
When you use script parameters, you can specify a preference type. Available preference types are Company and User or you can choose not to set a preference.
-
Company: For Company preference, the parameter's value comes from the value set in Setup > Company > General Preferences in the Custom Preferences tab. See the Example later in this section.
-
User: For User Preference, the parameter's value comes from the value set in Home > Set Preference in the Custom Preferences tab. This lets end users override the company default script behavior and set their own default value. End users can change script parameter values without modifying the script or its deployments.

If you don't set a preference, the script parameter is considered a "deployment" script parameter by default. In this case, you define the value of the script parameter on the Parameters tab of the Script Deployment record.

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 SuiteBundler Overview.
Example
In this example, the Suitelet script includes a parameter called Check Box Required (with the internal ID custscript_checkboxtest2 ) is set to the Company preference.

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 (true; the box is checked).

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

If the Check Box Required parameter had been set to F (false; the box is not checked), the box would have appeared empty on the form when the Suitelet was deployed.
See Creating Script Parameters for steps on creating a script parameter. Also see Referencing Script Parameters for information about accessing script parameter values.
Script Parameter Preferences and Bundles
Script parameters that have a user or company preference set are not updated in target accounts when the bundle is updated. Script parameters without a preference are part of the script deployment and are updated in target accounts based on the bundle object preference:
-
With Update Deployments, script deployment parameters in target accounts are updated to match the source account.
-
With Do Not Update Deployments, script deployment parameters in target accounts remain unchanged.
Set the preference to Company or User if target account users need to change parameter values. Users can change parameter values as needed, and these changes won't be overwritten on bundle update even if the related bundle object preference is set to Update Deployments.
To prevent changes, set the bundle object preference to Do Not Update Deployments for parameters without a preference.
For more information, see Bundle Object Preferences.