i have a saved search which is showing results in ...
# suitescript
v
i have a saved search which is showing results in the UI, but when i load it in the script and run, it shows the eroor 'Unexpected error'. How to resolve this?
n
try setting the search to public if it's not already.
v
thank you sir, its fine now
Copy code
SUM(formulanumeric)_1
how to take value of this result column?
result.getValue({name: "formulanumeric1",summary:"SUM"}); Before i used like this.
n
Do you only have one formulanumeric column?
v
no i have more than one.
n
I don't have an example in my code and haven't had to reference more than one recently. Normally for one, you drop the number altogether. I wonder if it's formulanumeric_1 though rather than formulanumeric1 🤔 I'll see if I can find out for you.
v
ok Thank you
n
You might have to use the columns from the saved search and use the columns index instead.
v
ok
n
If you search the slack channel you actually asked about this 3 months ago and have an answer that you said worked. so if the same resolution does not work, maybe it's not the approach but your data...
v
Thank you i used the column index and its ok
n
Just be aware that if the saved search changes, i.e. someone moves the columns around or adds / removes the columns you may run in to issues depending on how you're evaluating the columns. (this is why I prefer to code the saved search if it's static 😉 )