raghav
02/21/2025, 12:13 PMconst c3 = result.getValue({ name: 'formulanumeric', label: 'c1' })
const c4 = result.getValue({ name: 'formulanumeric', label: 'c2' })
battk
02/21/2025, 12:29 PMalien4u
02/21/2025, 2:41 PMalien4u
02/21/2025, 2:42 PMraghav
02/21/2025, 2:47 PMvar salesorderSearchObj = search.create({
type: 'salesorder',
filters: [
['type', 'anyof', 'SalesOrd'],
'AND',
['mainline', 'is', 'T'],
'AND',
['internalidnumber', 'equalto', '15580268']
],
columns: [
search.createColumn({ name: 'internalid', label: 'Internal ID' }),
search.createColumn({ name: 'amount', label: 'Amount' }),
search.createColumn({
name: 'formulatext',
formula: '{amount}+100',
label: 'c1'
}),
search.createColumn({
name: 'formulatext',
formula: '{amount}+200',
label: 'c2'
}),
search.createColumn({
name: 'formulanumeric',
formula: '{amount}+300',
label: 'c3'
}),
search.createColumn({
name: 'formulanumeric',
formula: '{amount}+400',
label: 'c4'
})
]
})
I could get the details by getting all columns using
var myColumns = salesorderSearchObj.columns and then itterating overall the columns, but was trying to avoid that.
I have done this in past, but can't seem to remember how.erictgrubaugh
02/21/2025, 3:41 PMColumn
instance. The resultToObject
function is the important bit.raghav
02/21/2025, 3:42 PMerictgrubaugh
02/21/2025, 3:52 PMformulanumeric_${label}
, but I still prefer this to trying to keep the Column
instance around. I'm nearly always processing my results in a different function/scope than where I created the Search
battk
02/21/2025, 6:16 PM