Custom record with only a 'name' column. Want to m...
# suitescript
l
Custom record with only a 'name' column. Want to map the name to the internal id without running a search on each name value. Can't do any anyof with an array because it's text.
Custom record with a single name column. If I want a filter in a search based on a list field sourced from that custom record need to use internal ids not names.
e
Still not clear what you're trying to accomplish. You have a custom record that only has a
name
field. You want to make the internal ID of each instance match its
name
?
or the other way round?
l
I want to create a search filter using 'anyof' and pass it an array of 'names'. Only works with internal ids though.
Wondering simplest way to get the internalid for each 'name'
e
Oh, yeah you won't be able to search text that way
l
Right
e
I see ok
l
Seems silly to do a single search for each name first
just to get the ids for the main anyof search
Seems like I run across this periodically
e
Well, you can search for multiple text values, you just can't do it as simply
standby
You're doing this in code? Or in a saved search?
Basically instead of
Copy code
['name', 'anyOf', listOfNames]
you need to do:
Copy code
[
  ['name', 'is', "name1"],
  "OR",
  ['name', 'is', 'name2'],
  'OR',
  // ...
]
excuse the inconsistent quotes
But that's the format you'll need your filters to be in