Beside the script you want to add a parameter to, click Edit.
Click the Parameters tab, and click New Parameter.
In the Label field, type the name of the parameter (custom field) as it will appear in the UI after the script is deployed.
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 a SuiteCloud project.
In the Type field, select the type of the script parameter (for example, Hyperlink, Date, Free-Form Text, or Check Box).
(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,
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.
(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:
Setting Display Options for Custom Fields
Setting Validation and Defaulting Properties
Setting Sourcing Criteria
Setting Filtering Criteria
Restricting Access to Custom Fields
Adding Translations for Custom Fields
Click Save to save the parameter.
On the script record, click Save to save the script record.