is there a API with which I can check whether a va...
# suitescript
r
is there a API with which I can check whether a value exists more than one time in the sublist field on line items?
n
No, you need to iterate the lines. There is an api call you can make to find a value but if it's not unique across the lines you'll have no idea that's the case as far as I know. It will just return a line index.
Copy code
let lineNo = transRec.findSublistLineWithValue({
          sublistId: 'item',
          fieldId: 'lineuniquekey',
          value: lineUniqueKey
        });
r
yeah I was using that
there should be a way
to get all the common values
n
"should" maybe but no.
It would be helpful if it at least returned an array of matches if found on more than one line.
r
It would been simpler to identify common values in sublist
but no. there isnt
s
you could use NFT then all the power of
lodash
is available.