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

Determine the number of records in a salesforce table without knowing the table's field names

I'm using the Salesforce REST API to determine the number of records in each Salesforce table. Ideally, I would be able to a query like this on each table: SELECT COUNT(*) FROM --or-- SELECT COUNT() FROM…
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
0
votes
2 answers

Join Case and User in Salesforce (SOQL)

I'm used to PostgreSQL but very new to SOQL and a bit confused about it. I would like to join rows from Case with rows from User based on User.Id. I've looked online and tried various solutions but nothing worked out. Does anyone know I could do…
Roog
  • 1
  • 4
0
votes
0 answers

Cannot Query Salesforce Object

I apologize if this is a duplicate issue, but I couldn't find a similar issue. I'm new here. I have a custom object in Salesforce that cannot be queried. It always times out. It used to do that sometimes, but then it would work. Now, I cannot query…
user3184786
  • 501
  • 1
  • 4
  • 7
0
votes
0 answers

Salesforce large query conditions: query 20000 contacts by emails and update fields

I have a csv file which has 20000 email addresses in it. I need to update some fields on these contacts. the dataloader is not suitable as I don't have the ID field of these email addresses. query in small groups will probably need to repeat more…
0
votes
1 answer

Salesforce Apex: List.add( value || 'default value')?

After querying for Account sObjects, I'm adding all the fields into a List. The problem is that some Account sObjects have certain fields and others do not. While adding the fields to my list, I'd like to be able to add field if it exists OR add a…
ZAR
  • 2,550
  • 4
  • 36
  • 66
0
votes
0 answers

System.QueryException: Non-selective query against large object type (more than 100000 rows)

I was working months with my class, but now give me the following error: "System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even…
0
votes
1 answer

PHP - Array grouping results from SOQL

I'm having issues with grouping an array returned from an SOQL query. The array contents are as follows (this is a clipped version to give an idea of structure): QueryResult Object ( [queryLocator] => [done] => 1 [records] => Array ( …
0
votes
1 answer

How to get records created in last 30 mins in a single SOQL query

I'm bit new to SFDC development. I'm currently working on project for which I need to get records created in last 30 mins from a SObject. Note: I want do this in a single soql query.
T3chn1nja
  • 31
  • 2
  • 7
0
votes
0 answers

accent insensitive search in SOQL

I am trying to do some accent insensitive search in SOQL. Using things like: SELECT name WHERE name LIKE '%andre%' I would like the database to return me a list of names like Alexandre, Andre or André. I already checked SalesForce link:…
Kin
  • 1
  • 1
0
votes
1 answer

How to select a specific number of random records in Salesforce per day?

Scenario: Each day Salesforce users create x number of new opportunities. At the end of the day, I would like to create a function (Workflow/APEX trigger etc.) to randomly select 3 of opportunities that were created in that day to send a survey…
SlowBlurry
  • 171
  • 2
  • 12
0
votes
1 answer

Why is Apex iterating backwards over this set?

I've never worked in Java before, let alone Apex, and not much with databases, so pardon me if I'm making some really stupid mistakes. I'm working on a VisualForce page to let staffmembers at my organization search for keywords in rich text fields…
RobertAKARobin
  • 3,933
  • 3
  • 24
  • 46
0
votes
1 answer

Soql query to access Topics associated with FeedItems in salesforce Chatter

I am trying to access FeedItems and topics(tags) associated to each FeedItem in a chatter Group. I am not able to figure out the relationship between FeedItems and Topics tagged with FeedItem. I am able to get all the FeedItems in a chatter Group…
Rajneesh Kumar
  • 167
  • 1
  • 13
0
votes
0 answers

Handling Unicode string pulled from SOQL In Python

The purpose of the code is to use SOQL to query the SalesForce API, then to format the data and do some stuff before putting putting it into an oracle database. My code successfully handles the first and third part but the second part keeps…
Jacobr365
  • 846
  • 11
  • 24
0
votes
1 answer

Apex code-how to get the data of campaign Members from Subquery

I am trying to display four fields on my VF page Name, Status from (Campaign Members) and Subject and Last Modified Date from (Activity History) Object.I am not able to fetch the Name and Status fields from Campaign Members. Can anyone please tell…
Rajashri
  • 1
  • 1
  • 1
0
votes
1 answer

How to Select from two tables in 1 query in Salesforce SOQL iOS

How can i combine this two request in salesforce SOQL query into 1 single request in iOS: NSString *theRequest = [NSString stringWithFormat:@"SELECT Name, OpportunityID FROM OpportunityLineItem where OpportunityID = '%@'", [companyDic…
Aldrin Equila
  • 165
  • 2
  • 17