I have a saved search that has a column `search.c...
# suitescript
a
I have a saved search that has a column
search.createColumn({
Copy code
name: "displayname",
join: "item"})
How can I retrieve the value with
result.getValue
? I tried
result.getValue("displayname"}
but it's null.
u
Copy code
result.getValue({
    name: "displayname",
    join: "item"
})
s
if with join, or summary, you gotta include that in your get value!
basically aside from label, just mimic the exact column and you wont fail
a
Aha. That worked.
🙌 2
s
also never forget to return true, but thats a different story 🙂
s
It might be easier to create an array of your columns, pass that array to your search creation and reference that array when processing results.
result.getValue()
has 2 ways, like
result.getValue(columns[i])
or object form as used above.
If you have formulas (especially long ones), the column index method is much more convenient