I am messing around with Suitelets and trying to l...
# suitescript
c
I am messing around with Suitelets and trying to load a simple save search There a simple way to return the type of a save search result column if it's a formula? I didn't understand why column.type wasn't working, but I read it has something to do with the fact that the column is a formula. Right now I have a workaround using typeof column.formula, but it's not ideal.
Copy code
var columns = savedSearch.columns;
  for (var i = 0; i < columns.length; i++) {
    var column = columns[i];
                
log.debug({
  title: 'column',
  details: column,
});
//returns: {"name":"formulatext","label":"label123","type":"text","formula":"'CreateApprovedPurchase'","sortdir":"NONE"}	

log.debug({
  title: 'column label',
  details: column.label,
});
//returns: Label123

log.debug({
  title: 'column Type',
  details: column.type,
})
//Expecting 'text', but it is blank

log.debug({
  title: 'column Type Workaround',
  details: typeof column.formula,
});
//returns: string
b
netsuite logging aims to be useful, not correct
c
haha great.
b
The Column Object Members doesnt actually have a type member
however the logs show the JSON output instead of the actual object (via .toJSON)
it just happens that the json object leaks the type