Questions tagged [soql]
Salesforce Object Query Language (SOQL), modeled on SQL, for accessing information saved in the Salesforce database.
6,013 questions
0 votes
0 answers
35 views
SOQL query error - Semi join sub-selects are only allowed at the top level WHERE expressions and not in nested WHERE expressions
I need to fetch Person account records that have either atleast one active contract or one active billing unit(custom object with lookup to account) I am using below query to retrieve the records in ...
0 votes
0 answers
26 views
How do I check from a SOQL query whether a permission set has access to an object like CampaignMember?
For reference, we have been trying to figure out whether a user has access to a given object type. The SOQL query we have been using currently looks something like SELECT PermissionsRead FROM ...
0 votes
1 answer
47 views
How do I find the field name for SOQL query?
I have a custom object called Contracted Individual which has API Name Contracted_Individual__c. When I look in the Object Manager, I can see that there are some custom fields, one of which is ...
0 votes
1 answer
65 views
Using Apex to query database, how do I combine two queries
I am writing an api that runs two queries. I'd like to merge the results and return that. I can't figure how to make a new object that contains the data from the two merged sObjects. @RestResource(...
3 votes
1 answer
138 views
SOSL/SOQL isn't returning User records
I have an Apex class receiving inbound data on a webhook. Class is running without sharing. Based on the inbound data, which includes a phone number, I'm running a SOSL query to find a matching ...
0 votes
0 answers
39 views
Pagination for big object 'ActivityFieldHistory' in salesforce fails
We tried a variety of options for this big object 'ActivityFieldHistory'. Many failed attempts. We use this library https://github.com/jesperfj/force-rest-api to execute the following query. SELECT Id,...
0 votes
0 answers
61 views
Apex library to convert a JSON string into a SOQL query dynamically in Apex
Is there any existing Apex library or tool that can interpret a JSON structure and convert it into a SOQL query automatically? Ideally, something that can take input like this (this is a simple ...
2 votes
1 answer
141 views
Optimize SOQL Query
I want to optimize my soql query which is currently like select id,…… From FeedItem Where Id > ‘…’ AND IsDeleted = False Order by Id LIMIT 64000 After this query it takes the 64000th id in above ...