Is it not possible to hide more than one column wi...
# suitescript
m
Is it not possible to hide more than one column with suitescript? I try and use this code for a timesheet, but it will only hide the first column. Is there another way?
function pageInit(context) {
var rec = context.currentRecord;
var sublistObj = rec.getSublist({
sublistId: 'timeitem'
});
var columnPrice = sublistObj.getColumn({
fieldId: 'price'
});
//set
columnPrice.isDisplay = false
var columnRate = sublistObj.getColumn({
fieldId: 'rate'
});
//set
columnRate.isDisplay = false;
t
I was able to get this to work. This works when they edit the record, do have it work when you Create a record, I changed the < to <= in the For line, and it worked // List of column IDs to disable var columnsToDisable = ['description', 'price', 'rate']; // Add more column IDs as needed for (var i = 0; i < lineCount; i++) { // Disable specific columns on each line item columnsToDisable.forEach(function(columnId) { currentRecordObj.getSublistField({ sublistId: 'item', fieldId: columnId, line: i }).isDisabled = true; // Set to true to disable the field }); }
m
This looks promising. Nice work! Thank you so much.