
soql - How to query NOT LIKE? - Salesforce Stack Exchange
} When I run the Query in SOQL Editor, it says "unexpected token: AND" SELECT Id, Name, Email, ProfileId FROM User WHERE NOT(Email like '%@example.com') AND ProfileId NOT IN …
soql - How to get the profile name and role name from User object ...
We already have a soql query to retrieve the User object (which returns the role id and profile id) was wondering if we could retrieve the RoleName and ProfileName from within the same query instea...
apex - SOQL Alias a column - Salesforce Stack Exchange
2 Finally we have found decision how to "rename" column in SOQL without using standart Aggregate function that requires Group by clause in the end, and unfortunately doesn`t allow to export more that …
SOQL: How to query records based on CreatedDate?
Dec 5, 2022 · From the opportunity object, using SOQL, I want to query records which have been created x days (say 30 days) before today. I have written the following code: List<Opportunity> …
SOQL query 414 URI Too Long: What's the actual length limit?
Apr 10, 2025 · The 100k character limit on the SOQL documentation page is for SOQL on its own, when written in Apex (Salesforce's proprietary, Java-like language). Since the URI length limit is 16,834 …
Custom Metadata getAll () vs SOQL query - Salesforce Stack Exchange
Oct 9, 2025 · It doesn't run a SOQL so it doesn't count against governor limits. Indeed the getAll() documentation states (emphasis mine): To iterate over the list of custom metadata type record …
How do I build a SOQL query for records in a list of IDs?
Dec 26, 2016 · Can some one correct my soql? I need to export records in data loader like: WHERE Id IN ('123123123','123123fsdf') But this following query does not work for me: SELECT Id, …
apex - SOQL Like Query? - Salesforce Stack Exchange
Nov 9, 2018 · The LIKE operator in SOQL and SOSL supports escaping of special characters % or _. Don’t use the backslash character in a search except to escape a special character. For example, …
soql - Query for records which have the city length > 20 - Salesforce ...
Nov 12, 2013 · I am looking for a way to query all leads which have the length of city__c > 20 characters in SOQL. I cant seem to find anything like a length() in SOQL. Any workarounds? Or am i missing …
How to select Unique values in SOQL - Salesforce Stack Exchange
Feb 25, 2015 · A SOQL alternative to selecting distinct rows: SELECT name, COUNT(Id) FROM Lead GROUP BY name Shows you all of the distinct names, with how many of them there are. One …