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
2
votes
1 answer

SOQL Use LIKE with EXPLICIT Collections

This syntax works ok for using like with collection : Set setAccNames = new Set(); setAccNames.add('ABC'); setAccNames.add('XYZ'); setAccNames.add('RST'); List accList = [SELECT Id FROM Account WHERE Name IN…
hcohen
  • 325
  • 6
  • 17
2
votes
2 answers

Salesforce/SOQL: How to retrieve all column names from Account?

I am trying to retrieve all the column names from Salesforce by SOQL Query that I get via Pentaho as well with the following code select QualifiedApiName from FieldDefinition where EntityDefinition.DeveloperName='Account' Pentaho lists 65 fields,…
notAnExpert
  • 123
  • 1
  • 5
  • 15
2
votes
2 answers

How can I traverse through multiple related objects based on ID and return some related field?

I'm a little stuck. I am trying to generate a report that determines whether anyone has made a manual change to certain fields within our order framework. I have figured out the proper fields and structures to audit, and even how to make the report,…
2
votes
1 answer

Using Socrata API distance_in_meters() function with separate latitude, longitude field

I am trying to retrieve information about trees surrounding a given location from the Socrata API. API Endpoint Description I found two functions within_circle(...) and distance_in_meters(...) which I could use to filter the data set. The problem…
Tantalos
  • 119
  • 1
  • 8
2
votes
1 answer

Output Array Items

I'm using Salesforce.com Toolkit for PHP and I'm trying to output something I think is very simple. THIS IS WORKING EXAMPLE CODE $query = "SELECT ID, Phone FROM Contact LIMIT 5"; $response = $mySforceConnection->query($query); foreach…
st4ck0v3rfl0w
  • 6,665
  • 15
  • 45
  • 48
2
votes
1 answer

SSIS: Convert datatypes in a SOQL query for a SSMS validation table

I am working on an EDW that is using SSIS to bring in SalesForce tables. I'm in the process of writing a validation query on the CData Salesforce Source that will return CURRENT_DATEIME() for when it was loaded as well as Sum of the Column values,…
CFJohnston
  • 93
  • 6
2
votes
1 answer

Name query in SQL/SOQL with " ' " as a part of the name

I need to write a soql/sql query which needs to look up for a name that has an apostrophes in it, Like shaquel o'Neil. The problem is that the where clauses dops the Neil part as that is considered as the end of the search criteria. Any suggestions…
OBL
  • 1,347
  • 10
  • 24
  • 45
2
votes
2 answers

Syntax Error in Azure Data Factory SOQL Query WHERE LastModifiedDate >= datetime

I'm working in Azure Data Factory V2, attempting to query from a Salesforce object where the LastModifiedDate in the object is greater than or equal to a recent date. I've been receiving syntax errors on extremely simple SOQL queries, queries that…
futurenow
  • 23
  • 1
  • 6
2
votes
1 answer

How to get salesforce Activity id

I have a salesforce query that extracting users time report SELECT ID,Logged_Date__c ,CreatedBy.Email, CreatedBy.id, CreatedBy.Name, Time_Spent_Hours__c, Activity__c, CaseId__r.CaseNumber, CaseId__r.Account.id, CaseId__r.Account.Name ,…
2
votes
1 answer

Simple_Salesforce: making bulk SQL calls within a date range

I'm using Simple_Salesforce to grab a chunk of data using the salesforce api. I was wondering if there was anyway to specify a date range when making calls. I keep getting the following error. query = 'SELECT Id, Name FROM Account WHERE createddate…
ATMA
  • 1,450
  • 4
  • 23
  • 33
2
votes
1 answer

Join 3 Salesforce objects using soql

I am trying to join the Pricebook2, Product2 and PricebookEntry objects together but do not understand how the syntax will work. The relationship between the 3 objects are Pricebook2 is 1 to many with PricebookEntry and Product2 is 1 to many with…
user3165854
  • 1,505
  • 8
  • 48
  • 100
2
votes
1 answer

Salesforce, accessing TargetObject fields from ProcessInstance object using SOQL

I have the following in my controller for a visualforce page which is consumed by a PageBlockTable. I can access other standard fields of the p.ProcessInstance.TargetObject such as p.ProcessInstance.TargetObject.Name and .Id etc... But how can I…
realtek
  • 831
  • 4
  • 16
  • 36
2
votes
2 answers

simple-salesforce not recognizing custom object

I am using simple_salesforce and get all records of a custom object called "SER__Condition__c". I know for a fact that that is the name because I got a list of table names from our administrator. "api" is an instance of…
Matthias Schreiber
  • 2,347
  • 1
  • 13
  • 20
2
votes
1 answer

Talend - Limit Number of Rows Processed

I'm working with Talend ETL to transfer data between two Salesforce Orgs. I'm trying to run preliminary tests to make sure everything is setup properly. Is there a way to limit the number of rows being transferred? The database has over 50,000…
Mowrite
  • 183
  • 1
  • 2
  • 10
2
votes
4 answers

How to check a specific string in List on a SQL Select statement?

I was wondering if its possible to add a condition like the code below in a select statement, and if it is, how should I do it ? code that looks like these SELECT first_name ,last_name FROM persons_table [condition: WHERE last_name is on…
JF-Mechs
  • 1,083
  • 10
  • 23