We can use record.selectNewLine(options) to select a new sublist line.
| Method Description | Selects a new line at the end of a sublist. (dynamic mode only) |
| Returns | record.Record |
| Supported Script Types | Client and server scripts |
| Governance | None |
| Module | N/record Module |
| Sibling Object Members | Record Object Members |
Parameters
| Parameter | Type | Required / Optional | Description |
|---|---|---|---|
options.sublistId | string | required | The internal ID of the sublist.This value is displayed in the Records Browser. |
Errors
| Error Code | Thrown If |
|---|---|
SSS_INVALID_SUBLIST_OPERATION | A required argument is invalid or the sublist is not editable. |
SSS_MISSING_REQD_ARGUMENT | A required argument is missing or undefined. |
Syntax
// Add additional code.
...
objRecord.selectNewLine({
sublistId: 'item'
});
...
// Add additional code.
Example
// Load the Sales Order record
let salesOrderRecord = record.load({
type: record.Type.SALES_ORDER,
id: salesOrderId,
isDynamic: true
});
// Select a new line at the end of the ‘item’ sublist
salesOrderRecord.selectNewLine({
sublistId: ‘item’
});