i have this value from the savedsearch ```{ val...
# suitescript
v
i have this value from the savedsearch
Copy code
{
   values: {
      "SUM(formulanumeric1)": "3",
      "SUM(formulanumeric2)": "3"
   }
}
i want to fetch 3, but am not able to do it. i had tried all means. coudl anyone please help? below is the code search.createColumn({ name: "formulanumeric1", summary: "SUM", formula: "CASE WHEN {quantity}-{quantityshiprecv} > 0 THEN 1 ELSE 0 END", label: "Open Lines" }), search.createColumn({ name: "formulanumeric2", summary: "SUM", formula: "{quantity}-{quantityshiprecv}", label: "Open Qty" })
n
from your results did you try using getValue({name: "formulanumeric1",summary:"SUM"}); ?
c
What I will often do for searches to simplify the process of working with columns is something like this snippet. Caveat here is that I typed this from memory and might have made a clerical error; the general approach is valid for sure.
r
Use labels when doing getValue or use getColumns and iterate through columns. Since both the field are formula fields you need to use something additional beside the name, summary,join. Label comes handy in those cases.
v
@NElliott Thank you it works
1
n
@raghav the formulanumeric fields are named sequentially formulanumeric1/2/3/4 as long as the order does not change, you can reference them directly as I mentioned. If the search is created in code and not being loaded, you're "probably" safe to reference them in this way.
👍 1