Function used to disable a column in a sublist

The Following suitescript function can be used to disable the column in a sublist.

/**
 * Function to be disable the column in a sublist
 *
 * @param {string} sublistId - id of the sublist
 * @param {string} fieldId - id of the field need to be disabled
 *
 */
function disableColumn(sublistId,fieldId){
//get the sublist from the record
var sublistObj = custrecord.getSublist({
    sublistId: sublistId
});
//get the field from the sublist need to be disabled
var columnObj = sublistObj.getColumn({
    fieldId: fieldId
});
//disable the field
columnObj.isDisabled = true;
}

Leave a comment

Your email address will not be published. Required fields are marked *