SuiteScript Tutorial - Script Parameters in SuiteScript | NetSuite
Автор: Sweet Scripts Studios
Загружено: 2024-07-30
Просмотров: 1066
Описание:
SuiteScript Tutorial - Script Parameters in SuiteScript | Third Party Library Files | NetSuite
Creating Script Parameters
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:
Go to Customization | Scripting | Scripts.
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).
For more information about field types, see Field Type Descriptions for Custom Fields.
(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.
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.
(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.
You can use the Script.getParameter(options) method to reference script parameters that you create. This method is included in the N/runtime module, and you can use other methods in this module to work with scripts and script objects. For example, use runtime.getCurrentScript() to obtain a runtime.Script object that represents your script. For more information, see N/runtime Module.
Before you can reference script parameters in your script, you must create them using the NetSuite UI. To learn how, see Creating Script Parameters. When you create a script parameter, make sure to remember the ID that you used (or the ID that was generated automatically for you). You must use this ID in your script to obtain the value of the script parameter.
⏱️⏱️VIDEO CHAPTERS⏱️⏱️
00:00 - Introduction to Script Parameters
00:45 - Types of Script Parameter
02:15 - User Preference Settings
02:40 - Company Preference Settings
03:10 - Script Level Preference Settings
03:45 - Script Explanation
05:25 - Testing the Script
06:00 - Checking output
07:40 - Conclusion
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: