does netsuite have any other formula function in s...
# general
k
does netsuite have any other formula function in save search similar to case when? or is that it? like for each ?
p
foreach doesn't really make sense in set-based things, I think. There's
DECODE()
and a few CONCAT() functions you can use. What are you trying to achieve?
k
i have multiple warehouse; when i run a save search of sales orders that dont have items committed, on my results pafe I am trying to see only the inventory in one warehouse; formula is as follows: CASE WHEN {inventorydetail.location}='Baxter Warehouse' THEN {item.quantityonhand} ELSE 0 END
but it always returns 0. Basically I want to say "for this result return the quantity on hand at this location
s
Create a formula result column with just
{inventorydetail.location}
, to check what it is returning
k
inventory detail location returns null
there is the beginning of the problem! inventory detail location isn't a field with values but location is! I just need to get it to now limit to just the one location
So i have this now: CASE WHEN {location}='Baxter Warehouse' THEN {item.quantityonhand} ELSE 0 END but it is still pulling from all locations
i think after my THEN I need to specify only the one location?
g
You may want to try adding the location to the criteria of the saved search, as opposed to the results
k
i tried that; still getting two when I know i only have one
i got it! It was {item.locationquantityonhand}
the only tricky part left is that I am getting a result for every line item of my sales order instead of just the one time
sorry; its not for every sales order line item; it is evaluating for every warehouse location
g
Have you tried using the {item.locationquantityonhand} in the criteria and setting that to the location you're looking for in your formula? If that works, then I don't think you would need to use the formula...
k
you got it!
thank you!
peanutbutterjellytime 1
g
Awesome! Glad it worked out