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
2 answers

NoClassDefFoundError: com.sforce.soap.enterprise.Connector

I am trying to query contacts from salesForce account but getting above error. I generated enterprise.jar file from the WSDL downloaded from my account. I have wsc-23-min.jar along with enterprise.jar files in libs folder. Below method is used to…
Braj
  • 2,164
  • 2
  • 26
  • 44
2
votes
0 answers

Querying from 2 related Salesforce objects using ruby databasedotcom gem

I have a php script that accesses some salesforce objects via soql, and I'm rewriting it to ruby. To understand my problem, assume that I have 2 salesforce custom objects that are associated with a parent-to-child relation. Using the Force.com…
Hernan Velasquez
  • 2,770
  • 14
  • 21
2
votes
1 answer

Convert Leads to Opportunity using Salesforce sdk for iOS

I am creating iOS application with the integration of SalesForce. I have created Xcode project with steps mentioned. I am able to get list of Leads, Contacts, Account, etc. I have one more feature regarding conversion of Leads into Opportunity. I'm…
user1988
  • 811
  • 2
  • 8
  • 17
2
votes
2 answers

Salesforce SOQl query

Is there any possibility of querying the fields using datatype. I need to query the email field of multiple objects. Email field names are different. So I am trying to get the data using the email datatype.
2
votes
2 answers

Why does Salesforce prevent me from creating a Push Topic with a query that contains relationships?

When I execute this code in the developer console PushTopic pushTopic = new PushTopic(); pushTopic.ApiVersion = 23.0; pushTopic.Name = 'Test'; pushTopic.Description = 'test'; pushtopic.Query = 'SELECT Id, Account.Name FROM Case'; insert…
J Smith
  • 2,375
  • 3
  • 18
  • 36
2
votes
2 answers

How to do inner or sub-query for the same object in SOQL

I'm facing an issue to select the value from the same object. I provided the query below. I'm migrating a Java J2EE application to Salesforce, the below query works in my SQL. I'm trying to do the same in SOQL, but it doesn't work. SELECT DATA1__c,…
Arun
  • 1,010
  • 6
  • 18
  • 37
2
votes
1 answer

System.DmlException: Update failed. first error: INVALID_CROSS_REFERENCE_KEY,

i am trying to update a ObjectPermissions Object in slaesforce such that a profile will get the permissions to access a object similar to other profile. i write a code my code segment is PermissionSet set1 = [SELECT Id From PermissionSet …
mathlearner
  • 7,509
  • 31
  • 126
  • 189
2
votes
4 answers

Trouble with SalesForce Query Results - PHP Toolkit

I am trying to query my SalesForce database using the PHP API. I am successfully retrieving results, however they are largely useless. When doing a print_r on the results, I receive these results from the following query: Query: $query = "SELECT…
user2223387
  • 31
  • 1
  • 3
2
votes
1 answer

Execution Confusion in Batch class Apex

I am calling a batch class instance and after completing the batch, I am calling two other batch class instances. The finish() method for first batch class is public void finish(Database.BatchableContext BC) { List events = [SELECT Id…
mathlearner
  • 7,509
  • 31
  • 126
  • 189
2
votes
1 answer

getting Value of a field by its Name in apex salesforce

in my visualforce page i have some campaign object first user select an object then there is a multi picklist. in this picklist there is Label for all the fields user selects some fields then i have to show the value of these fields in the selected…
mathlearner
  • 7,509
  • 31
  • 126
  • 189
2
votes
3 answers

Good ways to use Crystal Reports with Salesforce?

Does anyone know good ways/tools/approaches for using Crystal Reports with Salesforce.com? I know that Crystal Reports for Salesforce exists but I'm wondering what other possibilities there are...
codeulike
  • 22,514
  • 29
  • 120
  • 167
2
votes
2 answers

First error: INVALID_CROSS_REFERENCE_KEY, Assigned To ID: owner cannot be blank: [OwnerId]

I am writing a test for my controller. For that I have to insert an event in the test database. My test method is: static TestMethod void Test1_TestInsertWithValue() { Meeting_Master__c master = new Meeting_Master__c(); Event event = new…
mathlearner
  • 7,509
  • 31
  • 126
  • 189
2
votes
1 answer

Same SOQL Query taking a long time in a "VF page controller" VS in the "Developer Console"

Simple query, taking 1 minute in the VF page controller, and less than 1 second when executed in the Developer Console. There are more than 50,000 records that the query is searching through. Why such a dramatic difference in the query run…
Kirill Yunussov
  • 1,955
  • 1
  • 21
  • 24
2
votes
1 answer

SOQL - single row per each group

I have the following SOQL query to display List of ABCs in my Page block table. Public List getABC(){ List ListABC = [Select WB1__c, WB2__c, WB3__c, Number, tentative__c, Actual__c, PrepTime__c, Forecast__c from ABC__c ORDER BY…
sfdcFanBoy
  • 121
  • 1
  • 5
2
votes
1 answer

Salesforce Best Practice To Minimize Data Storage Size

I need to add an array of strings (approximately 1-5 strings 10-30 characters long) to one of my custom objects. From what I've read, Salesforce multiplies the total number of objects in your Org by 2Kb (regardless of actual size) to calculate your…
Greg
  • 8,574
  • 21
  • 67
  • 109