How to read current record in a custom module in SuiteScript 2.0

/**
 * @NApiVersion 2.0
 */

define(['N/currentRecord'], function(currentRecord) {

 return({
alertBox: function(){
var record = currentRecord.get();

var name = record.getValue({
fieldId: 'custpage_name',
})

alert(name);
}
 });


}

This simple module can be attached to suitelet or user event script and can be used by calling alertBox function directly.

Comments

Popular posts from this blog

What are sales territory in Netsuite?

How to get and set a sublist in netsuite suitlet suitescript 2.0