Linked Questions

5 votes
2 answers
10k views

SOQL multiple LIKE matches [duplicate]

I am trying to figure out the best way to do multiple LIKE matches in a complicated soql statement. I want to change the hubFilter value from just "BCS%" to "BCS%,Benefit Advisor,Mgr of Ben,BSR". I ...
Matt M's user avatar
  • 1,473
0 votes
1 answer
13k views

SOQL query using LIKE or Contains with IN [duplicate]

Are there any workarounds for creating a query using the LIKE operator on a set of strings? I would like to create a new object(Exclusions) which would house records that have a field for keywords ...
Logie C's user avatar
  • 123
6 votes
1 answer
3k views

Use a wildcard with the "IN" operator in a SOQL query [duplicate]

Essentially what I want to do is this: SELECT Id, Email FROM User WHERE Email in ('first.last1%','first.last2%') I am using this in a trigger and would like to come up with a query to match users ...
Matthew Mitchener's user avatar
1 vote
1 answer
190 views

Use Like in a single SOQL query [duplicate]

I have fixed set of Account Names stored in one custom object. Set<String> NameSet = new Set<String>(); Custom object NameSet account Name values: Intel, HP, Dell, IBM etc I have a ...
sfdcFanBoy's user avatar
  • 4,055
10 votes
2 answers
30k views

How to use LIKE and IN together in SOQL? [duplicate]

I have a requirement, for each Accountwhose name contains ‘Sale’, ‘Opportunity’, or ‘Catalog’, set Price_Type__c to ‘Net’. This is what I code in Anonymous Apex: set<string> myString = new Set&...
Noob_NoVoice's user avatar
  • 2,709
7 votes
2 answers
17k views

In SOQL, how do I get just the left N charactes for a compare?

In SQL, I could to something like: SELECT Id, Name, PostalCode FROM Account WHERE LEFT( PostalCode, 5 ) IN ('84117','84070'...) How do I do something similar in SOQL? I see date functions and ...
Robert Harper's user avatar
9 votes
1 answer
9k views

SOQL: Bulk Fuzzy Searching

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 ...
ZAR's user avatar
  • 2,013
3 votes
1 answer
2k views

Is LIKE Against a List Not Supported in Dynamic SOQL?

I'm trying to use LIKE in my dynamic SOQL with a list. My code: SELECT Id, Name FROM Account WHERE Name LIKE ('%somevalue%', '%testvalue%') I can't and I don't want to use variable reference for ...
d_k's user avatar
  • 1,291
0 votes
1 answer
1k views

Can I return entire record set when using the Execute Anonymous Window in Dev Console?

This article: Is there a way to do Like against a list of Values?, has a nifty workaround for lack of a LEFT(Column, n) function. I am able to execute a successful code snippet in the anonymous window ...
taylormatthewl's user avatar
0 votes
1 answer
171 views

Query a Collection Across Multiple Fields

I'm aware of this and this posts. They very well explains how to bulkify LIKE queries. But I have to query on multiple fields. Let say I have in input a list of account names: 1. Salvator Dali 2. ...
mcmc's user avatar
  • 529
2 votes
0 answers
226 views

Is there a way to do Like against a list of Values using the PHP API?

I need a way to find all articles that are related to a list of tags. Assuming the Articles_c object has a column Tags_c that holds a comma separated list of all tags that are applied to the article. ...
John Pope's user avatar