I have a list of accounts that I would like to perform a LIKE query on. Ideally, my query would be something like:
SELECT id, owner.name FROM Account WHERE name LIKE IN :entityList
Is there any way I can do this?
The issue is that my entity names come from a third party source, which means that small variations in name may be present, i.e
"Bay Ridge apt." VS "Bay Ridge Apartments"
It's hard to predict where the difference in spelling might be, and I was hoping that the LIKE filter might be some magical filter that can figure this out for me and match on a substring (i.e. "Bay Ridge").
The Salesforce guide doesn't include this option in their guide, so it might not be possible to combine a LIKE and an IN. Maybe there's a solution around it?
Maybe there's a way to perform a SOSL query on a list? Something like :
Find {entityList} In Account
I can't seem to find this any where...
Any guidance?
EDIT: It seems that it's not really possible to 'bulkify' SOSL queries. I could have ran a loop, but this would have hit governor limits. Using the LIKE filter with strategic wildcards was key.
Natrual Language Processing
. I don't think the SF platform is really capable of what you want without investing pretty heavily. You can combineLIKE
andIN
, though. It's just thatLIKE
isn't nearly as magical as you want it to be.