ReadOnlyTransactionRecord
Type |
Object |
Description |
Represents the current transaction record object passed to a Custom GL Lines plug-in implementation. Use the SuiteScript API functions available to the ReadOnlyTransactionRecord object to access field values on the transaction. 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 transaction record. You cannot write data to the transaction record. |
Properties |
|
Methods |
|
Child Object(s) |
id
Property Description |
Use this property to get the internal ID of a record when editing an existing transaction.
Note:
With the asynchronous Custom GL Lines plug-in, id is set even when creating a transaction. |
Type |
number (read-only) |
Parent Object |
recordType
Property Description |
Returns the record type internal ID. For example, returns |
Type |
string (read-only) |
Parent Object |
fields
Property Description |
Returns the body field names (internal IDs) of all the fields in the transaction record, 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 transaction record. |
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.fieldId |
string |
Required |
The internal ID of a standard or custom sublist field. |
options.sublistId |
string |
Required |
The internal ID of the sublist. |
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. |
getSublistSubrecord(options)
Method Description |
Returns the subrecord associated with a sublist field. |
Returns |
|
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. |
getSublistText(options)
Method Description |
Returns the value of a sublist field in a text representation.
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.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. |
getSublistValue(options)
Method Description |
Returns the value of a sublist field. |
Returns |
number | date | string | array | boolean |
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. |
getSubrecord(options)
Method Description |
Returns the subrecord for the associated field. |
Returns |
|
Parent Object |
Parameters
Parameter |
Type |
Required/Optional |
Description |
options.fieldId |
string |
Required |
The internal ID of a standard or custom sublist field. |
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. |
hasSublistSubrecord(options)
Method Description |
Returns the value indicating whether the associated sublist field contains a subrecord. |
Returns |
boolean |
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. |
hasSubrecord(options)
Method Description |
Returns the value indicating whether the field contains a subrecord. |
Returns |
boolean |
Parent Object |
Parameters
Parameter |
Type |
Required/Optional |
Description |
options.fieldId |
string |
Required |
The internal ID of a standard or custom sublist field. |