Hello, is there a way to check if search.lookupFie...
# suitescript
p
Hello, is there a way to check if search.lookupFields is returning a null value?
m
Set return value to a variable. Then null check the variable (ex: if(lookupVar === null) //do something...)
k
Actually null or just empty string, there is a difference.
Also check the length of the array because it will throw an error if you try the field when the result is empty
I find it helpful to log the output of the search.lookupFields before trying to handle the result so you can see what's actually in there whether it's empty or not
💯 1
m
Yeah I second logging the value. Especially since the format can be different depending on the field.
p
thanks
I was able to get it to working by checking if the value was null