I want to check if a transaction has a line with a...
# suitescript
s
I want to check if a transaction has a line with a particular custom field value in an After Submit UES. Anyone know if there is a performance advantage to performing a search for a line with that value vs loading the record and looping through the lines? (Multiple lines can have the value and I want the list of them)
d
would depend on the number of lines. For transactions with a particularly large number of lines, I would expect the search to be quicker. Not sure where that point would be though. I'd still suggest using a simple
N/query
, which should be faster than the search.
👍 1
s
If you're going to search, I'd suggest SuiteQL over imperative N/query
☝️ 1
Also, if you already needed to load the record anyway, I'd use the sublist. If you didn't otherwise need to load the record in aftersubmit, I'd probably stick with doing a [suiteql] search.