I am required to write some code that disables a transaction column e.g. ‘quantity’ on a sublist e.g. ‘item’ on say a purchase order
I seem to have reached a block as my code is not working (battling 2 days now). Please note I am new to coding in NetSuite so I suspect I am missing something really obvious.
I would appreciate very much any help offered.
See my code below:
/**
* @NApiVersion 2.0
* @NScriptType ClientScript
* @NModuleScope SameAccount
*/
define([‘N/record’],
/**
* @param {record} record
*/
function(record) {
function sublistChanged(scriptContext) {
var currentForm = scriptContext.currentRecord;
var getSublist = currentForm.getSublist({
sublistId: ‘item’
fieldId: ‘quantity’
});
getSublist.isDisabled = true;
}
return {
sublistChanged: sublistChanged,
};
});