We can use record.selectLine(options) to select a sublist line.
Method Description Selects an existing line in a sublist. (dynamic mode only) When working in standard mode, set a sublist field using Record.setSublistValue(options). 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.sublistIdstring required The internal ID of the sublist.This value is displayed in the Records Browser. options.linenumber required The line number to select in the sublist. Note that line indexing begins at 0 with SuiteScript 2.0.
Errors
Error Code Thrown If SSS_INVALID_SUBLIST_OPERATIONA required argument is invalid or the sublist is not editable. SSS_MISSING_REQD_ARGUMENTA required argument is missing or undefined.
Syntax
// Add additional code.
...
var lineNum = objRecord.selectLine({
sublistId: 'item',
line: 3
});
...
// Add additional code.
Example // Load the Sales Order record let salesOrderRecord = record.load({ type: record.Type.SALES_ORDER, id: salesOrderId, //Internal id of the sales order isDynamic: true }); // Select the first line in the 'item' sublist salesOrderRecord.selectLine({ sublistId: 'item', line: 0 });