Modules

filter

 

Objects/Functions

module (N/record)

SuiteScript 2.0

Sublist.getColumn(options)

{Sublist}.getColumn({fieldId: {string*}})

N/record Module
Sublist.getColumn()
Method Description: Returns a column in the sublist.
Returns: record.Column
Supported Script Types: Client and server-side scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/record Module
Sibling Object Members: Sublist Object Members
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Sublist.getColumn(options)

Example:

// Code Example 1
// Add additional code.
//...
var objRecord = record.load({
type: record.Type.SALES_ORDER,
id: 275
});

var objSublist = objRecord.getSublist({
sublistId: 'item'
});

var objColumn = objSublist.getColumn({
fieldId: 'item'
});

if(objColumn.type === 'checkbox'){
//Perform an action
}
//...
// Add additional code.

// Code Example 2
// Add additional code
//...
onRequest: function(context) {
var recordObj = record.create({type: record.Type.SALES_ORDER});
var columnList = recordObj.getSublistFields({sublistId: 'item'});
var sublistObj = recordObj.getSublist({sublistId: 'item'});

for (var i = 0; i < columnList.length; i++) {
var columnId = columnList[i];
var columnObj = sublistObj.getColumn({fieldId: columnId});
if (columnObj !== null) {
log.debug('[Column id] = ' + columnObj.id + ' [Column type] = ' + columnObj.type +
' [Column label] = ' + columnObj.label);
}
}
}
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4600579417.html