Вы должны создать клиентский скрипт:
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
*/
define(['N/record'],
function (record) {
function lineInit(context) {
try {
/** this will disable the amount for existing line */
var rec = context.currentRecord;
var itemCount = rec.getLineCount('item');
var sublistName = context.sublistId;
var line = rec.getCurrentSublistIndex({ sublistId: sublistName });
if (itemCount > line) {
var theField = rec.getSublistField({
sublistId: sublistName,
fieldId: 'amount',
line: line
});
theField.isDisabled = true;
}
/** this will hide the amount label for the new line : inspect the tag ID input#amount_formattedValue*/
if (!document.getElementById('hidden-amount-style')) {
var css = 'input#amount_formattedValue { display: none; }',
head = document.getElementsByTagName('head')[0],
style = document.createElement('style');
head.appendChild(style);
style.type = 'text/css';
style.id = 'hidden-amount-style';
style.appendChild(document.createTextNode(css));
}
} catch (e) {
console.error('? lineInit', JSON.stringify(e, null, 4));
}
}
function pageInit(context) { }
function validateField(context) { return true; }
function fieldChanged(context) { }
function postSourcing(context) { }
function lineInit(context) { }
function validateDelete(context) { return true; }
function validateInsert(context) { return true; }
function validateLine(context) { return true; }
function sublistChanged(context) { }
function saveRecord(context) { return true }
return {
pageInit: pageInit,
fieldChanged: fieldChanged,
postSourcing: postSourcing,
sublistChanged: sublistChanged,
lineInit: lineInit,
validateField: validateField,
validateLine: validateLine,
validateInsert: validateInsert,
validateDelete: validateDelete,
saveRecord: saveRecord,
};
});