Script.getParameter(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Returns the value of a script parameter for the currently executing script.

For information about script parameters, see Creating Script Parameters Overview.

Returns

number | Date | string | boolean | null | undefined

Supported Script Types

Client and server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/runtime Module

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.name

string

required

The name of the script parameter.

2015.2

Errors

Error Code

Thrown If

SSS_MISSING_REQD_ARGUMENT

The options.name parameter is not specified.

WRONG_PARAMETER_TYPE

The value for the options.name parameter is not a string.

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/runtime Module Script Samples.

          // Add additional code 
...
var scriptObj = runtime.getCurrentScript();
log.debug('Script parameter of custscript1: ' + 
     scriptObj.getParameter({name: 'custscript1'}));
...
// Add additional code 

        

Related Topics

runtime.Script
N/runtime Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices