RE: How to hide sublist fields in beforeload in SuiteScript 2.0 of current record?

The below code gives the following error : ‘

TypeError: Cannot find function updateDisplayType in object standard record.



define(['N/record', 'N/log', 'N/search', 'N/task', 'N/ui/serverWidget'],
function(record, log, search, task, serverWidget) {
function beforeLoad(scriptContext) {
log.audit('In before laod UE');
if (scriptContext.type == 'create' || scriptContext.type == 'copy') {
var currentRecord = scriptContext.newRecord;
var deliItem = currentRecord.setSublistValue({

sublistId: 'recmachcustrecord_rent_rod_delivery_note',

fieldId: 'custrecord_rent_rod_delivered_item',

line: 0,

value: 400


displayType: serverWidget.FieldDisplayType.HIDDEN

return {

beforeLoad: beforeLoad





ankkhan7 Rookie Asked on March 12, 2020 in SuiteScript.
Add Comment
2 Answers

Do you have any code snippet for the same in UserEvent script in 2.0?

Rookie Answered on March 12, 2020.

Documentation for getting the field is fairly clear about how the code should look. Same thing about using updateDisplayType

on March 12, 2020.

Thanks buddy got it.

on March 12, 2020.

Did something like this :


var itemField = form.getSublist({

id: 'recmachcustrecord_rent_rod_delivery_note'


id: 'custrecord_rent_rod_delivered_item'


displayType: serverWidget.FieldDisplayType.HIDDEN


on March 12, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.