Creating Script Parameters


This topic applies to all versions of SuiteScript.

Use the following steps to create script parameters. If you are unsure how to create a script record, see Creating a Script Record.

To create a script parameter:

  1. Go to Customization > Scripting > Scripts.

  2. Beside the script you want to add a parameter to, click Edit.

  3. Click the Parameters tab, and click New Parameter.

  4. In the Label field, type the name of the parameter (custom field) as it will appear in the UI after the script is deployed.

  5. In the ID field, type a custom ID for the script parameter.

    Script parameter IDs must be in lowercase and contain no spaces. They also cannot exceed 30 characters.

    You can leave the ID field blank to use a system-generated ID. However, it is a best practice to create your own custom ID for script parameters. Doing so will help avoid naming conflicts if you later decide to include your script in an SDF project.

  6. In the Type field, select the type of the script parameter (for example, Hyperlink, Date, Free-Form Text, or Check Box).

    For more information about field types, see Field Type Descriptions for Custom Fields.

  7. (Optional) If the parameter type is List/Record, in the List/Record field, specify the list or record.

    If you define a saved search as a List/Record script parameter, only saved searches that are public will appear in the List/Record field. For more information about working with searches using SuiteScript, see N/search Module.

  8. In the Preference field, select the set of preferences that you want to use for the parameter.

    Depending on the value of this field, the parameter’s default value is based on the values set on either the General Preferences page (for a field value of Company), Set Preferences page (for a field value of User), or the portlet setup page (for a field value of Portlet). If you do not specify a preference, the parameter is considered to be a deployment script parameter, and its value is defined on the script deployment record.

    For more information, see Setting Script Parameter Preferences.

  9. (Optional) Use the Display, Validation & Defaulting, Sourcing & Filtering, Access, and Translation tabs to define additional values for the parameter.

    For information about defining these values, see the following help topics:

  10. Click Save to save the parameter.

  11. On the script record, click Save to save the script record.

General Notices