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
David B
07/03/2023, 11:25 PM
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
Shawn Talbert
07/05/2023, 6:13 PM
If you're going to search, I'd suggest SuiteQL over imperative N/query
☝️ 1
Shawn Talbert
07/05/2023, 6:14 PM
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.