I created a custom record A and its related sublist B. When viewing the A record, it seems that the following method cannot hide specific fields in the sublist (subrecord B), although it can be hidden in edit mode. Are there any other ways to hide fields in this scenario (besides using CSS)?
Thanks!
const beforeLoad = (scriptContext) => {
if (scriptContext.type == 'view'){
let sublist = form.getSublist({id: 'recmachcustrecord_sublist_id'});
let subField = sublist.getField({id: 'custrecord_sublist_field_id'});
log.debug('subField',JSON.stringify(subField))
// log.debug result: {}
subField.updateDisplayType({
displayType: 'hidden'
});
}
}