CurrentRecord.getSubrecord(options)

Method Description

Gets the subrecord associated with the field.

If the subrecord does not exist, a new subrecord is created and returned.

Returns

currentRecord.CurrentRecord

Supported Script Types

Client scripts

For more information, see SuiteScript 2.x Client Script Type.

Note:

Setting values of Inventory Detail subrecord is currently not supported in Client scripts since the subrecord object in this context is only available in view-mode.

Governance

None

Module

N/currentRecord Module

Since

2016.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.

2016.2

Errors

Error Code

Thrown If

FIELD_1_IS_DISABLED_YOU_CANNOT_APPLY_SUBRECORD_OPERATION_ON_THIS_FIELD

The specified field is disabled.

FIELD_1_IS_NOT_A_SUBRECORD_FIELD

The specified field is not a subrecord field.

SSS_INVALID_FIELD_ON_SUBRECORD_OPERATION

The specified fieldId does not refer to a subrecord.

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

          //Add additional code 
...
var sublistFieldValue = objRecord.getSubrecord({
    fieldId: 'subrecord'
});
... 
//Add additional code 

        

Related Topics

General Notices