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

How to create subquery in SOQL, Opportunity - User tables

I have a Salesforce query which is pulling all the necessary columns from Opportunity table. It is something like that Select o.Opportunity_ID__c, o.LastModifiedDate, o.Opportunity_Currency__c, o.Opportunity_Type__c FROM Opportunity o ORDER BY…
ms_jordan
  • 151
  • 1
  • 1
  • 8
0
votes
1 answer

Join in salesforce query

I am using salesforce sdk. I want to fetch records using inner join. I have 2 tables Campaign and Attachment. Each Campaign has a single Attachment. SELECT Campaign.CustomerName, Attachment.Body FROM Campaign INNER JOIN Attachment ON Campaign.Id =…
0
votes
1 answer

Dynamic SOQL Query

I'm trying this code for dynamic results but it's showing the error shown below. Kindly help me with this code. System.QueryException: Only variable references are allowed in dynamic SOQL/SOSL. boolean first = true; string…
Venky
  • 103
  • 1
  • 4
0
votes
1 answer

Large soql queries (over 5000 characters long) to socrata is not supporting

I am using SodaClient to get information from a private data set in Socrata using the following code. var records = (dynamic)null; string searchCondition = "column1='something'AND (column2='something' OR 'somethingelse') "; var clientExport = new…
Nachikethas
  • 43
  • 1
  • 8
0
votes
0 answers

How to do a check against a bool(true) or bool(false) value from salesforce

I am having trouble trying to do a if statement that checks if the bool value returned from salesforce SOAP API is true or false? when I var_dump() the variable it returns bool(true) that is because the checkbox is ticked in salesforce. If I untick…
thechrishaddad
  • 6,523
  • 7
  • 27
  • 33
0
votes
1 answer

SOQL Query in loop

The following APEX code: for (List list : [select id,some_fields from MyObject__c]) { for (MyObject__c item : list) { //do stuff } } Is a standard pattern for processing large quantitues of data - it will automatically break up…
NickJ
  • 9,380
  • 9
  • 51
  • 74
0
votes
2 answers

SOQL and Simple Salesforce query

I have a custom object "DisableUserTask__c" with a field "DisableOn__c." I'm at trying to come up with a query to find any "DisableUserTask__c" task with a "DisableOn__c" field that is passed, but I can't seem to come up with a query. When I run a…
Daniel Dow
  • 487
  • 1
  • 7
  • 20
0
votes
1 answer

Attachments in Apex SOQL Subquery

I have custom objects Team member and Employment, and there's a lookup relationship from employment(many) to team member(one), plus another lookup record on team member called current employment. The employment record may have attachments. I want a…
NickJ
  • 9,380
  • 9
  • 51
  • 74
0
votes
1 answer

Complex SOQL query for parent/child records

I'm trying to figure out the most efficient way to build a query. I have a "Category" object and in that category object there is a "Parent_Category__c" field. The category is for a Product (and there is a "Product_Category__c" junction object…
0
votes
1 answer

How to run SOQL query via jquery ajax?

I've been following the guide here on making an apex rest call via ajax, but all I get is a status 0 error. http://www.oyecode.com/2014/02/how-to-salesforce-rest-api-from-browser.html Are there other guides/tutorials on how to make a SOQL query via…
Eric
  • 111
  • 7
0
votes
2 answers

How to pass user authentication of a private dataset through SODA API?

I need to access a private data set in socrata using SODA API. Suppose below link is the data set https://data.cityofchicago.org/resource/xxxx-xxx.json I get the following error when try this. "error" : true, "message" : "You must be logged in to…
Nachikethas
  • 43
  • 1
  • 8
0
votes
1 answer

Get Grandchild Object Field Values from Parent Object

I'm a newbie at sales-force apex coding. I have 3 custom objects, Location(Parent) -> Group(child) - > Meeting(grand child). All are related to each other through Master detail relationships. I am trying to get 2 field values from the earliest…
Rufus K.
  • 107
  • 1
  • 6
0
votes
1 answer

Monthly Revenue Split Custom report using Salesforce

I am attempting to create a report that would provide me a month to month break down of revenue based on the opportunity's start date, end date and Total Revenue to be expected. Example: Start Date: 2014-08-03 End Date: …
user1347948
0
votes
1 answer

Salesforce: SOQL to query Master that has at least X amount of details associated

I'm trying to set up a query that will return which contacts have over 5 deals with us. We have a custom sObject which is (terribly) named, contacts_deals__c which serves as an intermediary table between contact and deals__c. Contact is the master…
ZAR
  • 2,550
  • 4
  • 36
  • 66
0
votes
1 answer

Increasing Batch size in SOQL

I am using simple_salesforce package in python to extract data from SalesForce. I have a table that has around 2.8 million records and I am using query_more to extract all data. SOQL extracts 1000 rows at a time. How can I increase the batchsize in…
shyam
  • 21
  • 2