Record.getValue(options)

Method Description

Returns the value of a field.

(dynamic and standard mode — see SuiteScript 2.x Standard and Dynamic Modes)

Gets a numeric value for rate and ratehighprecision fields.

The following code sample demonstrates getValue() method on a multiselect field:

                    var value = objRecord.getValue({
    fieldId: 'customer'
}); 

                  

In this example, getValue() returns an array of customer IDs (for example, ['11', '15', '23', '46'])

Returns

number | Date | string | array | boolean

Returns a JavaScript Date object for date/time field queries. To return a string for date/time field queries, use Record.getText(options). Date/time fields: DATE, DATETIME, DATETIMETZ, TIMEOFDAY.

Note:

If the returned date object is implicitly converted to a string, the value is converted using the browser’s setting for time zone.

All fields of type CHECKBOX return true or false.

All multiselect fields return an array of values.

Supported Script Types

Client and server scripts

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

Governance

None

Module

N/record Module

Sibling Object Members

Record Object Members

Since

2015.2

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

Since

options.fieldId

string

required

The internal ID of a standard or custom body field.

See, Finding Internal IDs of Record Fields.

2015.2

Errors

Error Code

Thrown If

SSS_INVALID_API_USAGE

Invoked in standard mode, if you use setText or getText on a field and use getValue on the same field.

SSS_MISSING_REQD_ARGUMENT

A required argument is missing or undefined.

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/record Module Script Samples.

          // Add additional code
...
var value = objRecord.getValue({
    fieldId: 'item'
});
...
// Add additional code 

        

Related Topics

General Notices