Questions tagged [soql]

SOQL is the Salesforce Object Query Language.

SOQL, the Salesforce Object Query Language is a SQL like syntax used on the force.com platform to query records within a Salesforce instance. It can be used in triggers, or fully fledged Apex code, or via their web services API.

748 questions
0
votes
1 answer

Maximum 2 semi join sub-selects are allowed (Salesforce)

Fairly new to APEX (Salesforce development) and i found an issue with one of SOQL statements... This is the code that is creating the problem.. i did some research and i found that i need to create a set of id's instead of using another select…
JeyJim
  • 21
  • 1
  • 2
  • 10
0
votes
1 answer

How to use if condition in SOQL?

How to reproduce the following statement of MySQL in SOQL: SELECT IF(1 = 2,'true','false'); I am trying to do the following: select if(field1=null,false,true) as res from table But it is showing me unknown parsing error.
Richa Sinha
  • 1,406
  • 15
  • 29
0
votes
1 answer

List of all objects with labels and API names

I am looking for a way to get list of all objects with the labels and the API names, to be displayed on visual force page. Any ideas or samples on how to achieve this. Please help.
user1586243
  • 51
  • 2
  • 7
0
votes
1 answer

SoQL query for unique values with Socrata API

I am trying to count the total unique number of heating complaints in the Socrata NYC 311 service requests database: https://data.cityofnewyork.us/Social-Services/All-Heat-complaints-to-311/m5nm-vca4 Ideally I want to use the data to populate a map…
Andrew H
  • 46
  • 1
  • 4
0
votes
1 answer

Resforce SOQL Query Error Bind variables only allowed in Apex code

I have a controller action that needs to take the Account ID of the logged in user (parent) and make a SOQL query to find all of children associated with the parent. I receive the following error: Bind variables only allowed in Apex code After…
Questifer
  • 1,113
  • 3
  • 18
  • 48
0
votes
1 answer

Aggregate query does not support queryMore(), use LIMIT to restrict the results to a single batch Error

I am using a SOQL like below select COUNT(Transaction_Type_Id__c) tt, Id__c from Analysis_set_header__c group by Id__c The Object having total 42 records.but I am getting error like Aggregate query does not support queryMore(), use LIMIT to…
user989184
  • 141
  • 2
  • 6
  • 16
0
votes
1 answer

Comparison of multiselect picklist with a field in text format in apex

I have an object with number of records in this format with Name in Text format - Id Name 1 A,B,C 2 A,B 3 A 4 B 5 A,C 6 A,D I have a multi-select picklist with values as: A B C D So if I select B and C in my picklist, then I must…
Pranay
  • 1
  • 1
  • 1
0
votes
1 answer

Filtering Opportunities by Tasks using SOQL?

I'd like to pull all Opportunity IDs that have a task associated with a certain person. I've tried the following Select ID from Opportunity where AccountID IN (Select AccountID From TASK WHERE CreatedBy.Name='Person' OR LastModifiedBy.Name='Person'…
Chris
  • 5,444
  • 16
  • 63
  • 119
0
votes
1 answer

SoQL count query with Socrata API

I'm trying to count the unique number of case_numbers between 2014-02-27 and 2014-02-28 from the chicago crime database. The data source is here: http://data.cityofchicago.org/resource/ijzp-q8t2.json The API docs are…
dfriestedt
  • 483
  • 1
  • 3
  • 18
0
votes
1 answer

Salesforce apex collaborationgroup/collaborationgroupmember relationship?

I'm trying to get a list of collaboration groups and their associated members. I'm trying to do the following soql query but it does not recognise the CollaborationGroup.CollaborationGroupMembers relationship List cgs = new…
0
votes
1 answer

SOQL query :Salesforce

Suppose we have three objects account(id,name) opportunity(id,amount,stage) properties(id,address) account object has one to many relationship to opportunity object and opportunity object has one to many relationship to properties object . And we…
user3827145
  • 3
  • 1
  • 3
0
votes
1 answer

Nested SOQL check if children exist on parent

The Query should check if any children exist on the parent(opportunity) when i create a new child(project join). Where am I going wrong? Opportunity__c is master detail field on the child Project Join custom object. It is still pulling from all…
Rich
  • 35
  • 1
  • 5
  • 12
0
votes
1 answer

Calling .getDescribe() on result of SOQL query

If I have an SOQL query as follows, which returns only 1 field. String this_soql = 'SELECT SUM(Revenue_Target__c) revenueTarget FROM DM_Account_Plan__c WHERE Id=: the_Id GROUP BY Id'; SObject r = Database.query(this_soql); Can I then go on to get…
Daft
  • 10,277
  • 15
  • 63
  • 105
0
votes
1 answer

Using python simple-salesforce is there a way to query logically deleted records?

Is there a way to query Salesforce records that have been deleted, using python simple-salesforce? In other words can it do this: SELECT Id FROM Contact WHERE isDeleted=true and masterRecordId != null AND SystemModstamp >…
dlink
  • 1,489
  • 17
  • 22
0
votes
1 answer

SOQL Count with multiple Where clauses

I am trying to count all the results that match multiple Where conditions in Salesforce. All these Where conditions exist under the same object that I am selecting from. It seems like it should be a simply query but my SQL and SOQL experience is…
Alex Kuhar
  • 11
  • 4