ReadOnlySubrecord
|
Type |
Object |
|
Description |
Represents a subrecord object from the transaction record passed to a Custom GL Lines plug-in implementation. Use the SuiteScript API functions available to the ReadOnlySubrecord object to access field values on the subrecord. Field and sublist internal IDs can be found in the SuiteScript Record Browser. For more information, see Working with the SuiteScript Records Browser.
Note:
You can only use functions to read values from the subrecord. You cannot write data to the subrecord. |
|
Properties |
|
|
Methods |
|
|
Parent Object |
fields
|
Property Description |
Returns the body field names (internal IDs) of all the fields in the subrecord, including the machine header field and matrix header fields. |
|
Type |
string[] (read-only) |
|
Parent Object |
sublists
|
Property Description |
Returns all the names (internal IDs) of all the sublists in the subrecord. |
|
Type |
string[] (read-only) |
|
Parent Object |
findSublistLineWithValue(options)
|
Method Description |
Returns the line number for the first occurrence of a field value in a sublist. Note that line indexing begins at 0 with SuiteScript 2.0. |
|
Returns |
A line number as a number, or -1 if not found. |
|
Parent Object |
Parameters
|
Parameter |
Type |
Required/Optional |
Description |
|
options.sublistId |
string |
Required |
The internal ID of the sublist. |
|
options.fieldId |
string |
Required |
The internal ID of a standard or custom sublist field. |
|
options.value |
number |date | string | array | boolean |
Optional |
The value to search for. |
getLineCount(options)
|
Method Description |
Returns the number of lines in a sublist. |
|
Returns |
number |
|
Parent Object |
Parameters
|
Parameter |
Type |
Required/Optional |
Description |
|
options.sublistId |
string |
Required |
The internal ID of the sublist. |
getSublistFields(options)
|
Method Description |
Returns all the field names (internal IDs) in a sublist. |
|
Returns |
string[] |
|
Parent Object |
Parameters
|
Parameter |
Type |
Required/Optional |
Description |
|
options.sublistId |
string |
Required |
The internal ID of the sublist. |
getSublistText(options)
|
Method Description |
Returns the value of a sublist field in a text representation.
Important:
This API is not available in synchronous Custom GL Lines plug-in configuration. |
|
Returns |
string |
|
Parent Object |
Parameters
|
Parameter |
Type |
Required/Optional |
Description |
|
options.sublistId |
string |
Required |
The internal ID of the sublist. |
|
options.fieldId |
string |
Required |
The internal ID of a standard or custom sublist field. |
|
options.line |
number |
Required |
The line number for the field. Note that column indexing begins at 0 with SuiteScript 2.0. |
getText(options)
|
Method Description |
Returns the text representation of a field value.
Important:
This API is not available in the synchronous Custom GL Lines plug-in configuration. |
|
Returns |
string |
|
Parent Object |
Parameters
|
Parameter |
Type |
Required/Optional |
Description |
|
options.fieldId |
string |
Required |
The internal ID of a standard or custom sublist field. |
getValue(options)
|
Method Description |
Returns the value of a field. |
|
Returns |
number | date | string | array | boolean |
|
Parent Object |
Parameters
|
Parameter |
Type |
Required/Optional |
Description |
|
options.fieldId |
string |
Required |
The internal ID of a standard or custom sublist field. |