David B
01/23/2023, 11:43 PMrecord.findSublistLineWithValue()
the "value" param takes types: number | Date | string | array | boolean
as a sublist field (specifically a transaction line field in my case) can't be type multi-select, what kind of field would match a value of type array
?David B
01/23/2023, 11:44 PMShawn Talbert
01/23/2023, 11:49 PMShawn Talbert
01/23/2023, 11:49 PMDavid B
01/23/2023, 11:55 PMdoFindSublistLineWithValue
code and there's nothing specific to handle arrays.
Interestingly it specifically accepts string/number matches (like "1" == 1
)
And also accepts where value is true
or false
, but the field value is "T" or "F"Shawn Talbert
01/23/2023, 11:57 PMDavid B
01/23/2023, 11:57 PMDavid B
01/23/2023, 11:57 PMDavid B
01/23/2023, 11:58 PMShawn Talbert
01/24/2023, 12:00 AM_.find(so.item, i => _.includes(i.multiselectfield, 34))
Shawn Talbert
01/24/2023, 12:01 AMShawn Talbert
01/24/2023, 12:02 AMso
is a sales order and it's the item
sublist you are trying to match a line from.Shawn Talbert
01/24/2023, 12:03 AMShawn Talbert
01/24/2023, 12:04 AM_.find()
anywhere, I tend to stick to it and don't even think about findSublistLineWithValue()
special API and I don't think anyone has found it to be faster than something like _.find()
Shawn Talbert
01/24/2023, 12:05 AM_.find(so.item, i => _.includes(i.multiselectfield, '34'))
David B
01/24/2023, 12:05 AMDavid B
01/24/2023, 12:06 AMShawn Talbert
01/24/2023, 12:06 AMShawn Talbert
01/24/2023, 12:06 AMShawn Talbert
01/24/2023, 12:08 AMShawn Talbert
01/24/2023, 12:09 AM_.find(so.item, i => _.includes(i.multiselectfield, '34'))
is understandable by anyone already familiar with lodash or similar collection libraries and modern JS.Shawn Talbert
01/24/2023, 12:10 AMShawn Talbert
01/24/2023, 12:12 AMfundSublistLineWithValue()
let alone knowing in addition the idiosyncrasies with that specific function.