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

Not able to return a field from a child of a parent in SOQL

I have tested the following query which is successful but when apply the query to my custom object it fails. i need to find out what is causing the issue. SELECT Id, Account.Name FROM Contacts WHERE AccountId in (SELECT Id FROM…
Bartley
  • 290
  • 2
  • 7
  • 21
0
votes
2 answers

SOQL equivalent of countif

Is there something equivalent to the excel countif function (http://www.techonthenet.com/excel/formulas/countif.php) in SOQL ? This is especially important in group by queries. In oracle I would use the case function together with the case…
David Michael Gang
  • 7,107
  • 8
  • 53
  • 98
0
votes
1 answer

How to convert Explicitly in Salesfore SOQL - Invalid bind expression type of SOBJECT

Is there a way I can do this in SOQL? (this is a sql statement) Convert(varchar(35),[FieldName1]) I'm trying to do a SOQL WHERE statement to compare an account and opportunity. This is What I want: SELECT Convert(VarChar(35),FieldName1),…
user1991372
  • 69
  • 4
  • 12
0
votes
1 answer

Salesforce SOQL access the managed package object

In Account object, I have a custom field named "Company" which in a managed package (Namespace Prefix: act). How can I get the value from this custom field by SOQL? Thanks in advance!
George
  • 1
  • 2
0
votes
2 answers

soql query in salesforce

AggregateResult[] groupedResultCall = [ SELECT Account_vod__c, count(Id) FROM Call2_vod__c WHERE Call_Date_vod__c >= :QuarterStartDate …
sf.dev
  • 105
  • 1
  • 5
0
votes
2 answers

About salesforce SOQL relationship query

How to get the parent object field from Task standard object using relationship query. select whatid,what.Email__c from Task. Its showing error. How can I get the email field from various object which is related to Task. If anyone knows help.
0
votes
1 answer

Why does Salesforce consider this simple parent-to-child relationship SOQL query not valid?

A CaseMilestone record can have one Case record and one Case record can have many CaseMilestone records. So this works: SELECT Id, (SELECT Id FROM CaseMilestones) FROM Case Similarly, a CaseMilestone record can have one MilestoneType record and one…
J Smith
  • 2,375
  • 3
  • 18
  • 36
0
votes
1 answer

Apex Trigger - Attempting to send an email after an update

so I have just finished a degree in computing and have just started industry related employment and wow... we really don't seem to learn much at uni, just the bare basics. Anyway, I am learning Apex and attempting to write my first trigger. The…
Phil
  • 1,393
  • 5
  • 23
  • 42
0
votes
1 answer

How much Maximum Data we can store in a File in salesforce

i searched a little for the size of file in salesforce . i found this link http://help.salesforce.com/HTViewHelpDoc?id=collab_files_size_limits.htm&language=en_US its showing that file size can be upto 2 GB.i have to store IDs in a text file…
mathlearner
  • 7,509
  • 31
  • 126
  • 189
0
votes
1 answer

How to get the Lookup objects and detail object related to a Standard Object

i have to delete Account Object record and the cases ,opportunities custom objects which are related to this particular Account ,i have to point these all records(opportunities,cases etc) to some Other Account object record .can any one please…
mathlearner
  • 7,509
  • 31
  • 126
  • 189
0
votes
1 answer

Include additional conditions in a single SOQL query

I have a SOQL build as following: SELECT Subject, IsChild, StartDateTime, Owner.UserName, Owner.Email, Notes_Universal_ID__c, Location, IsPrivate, IsDeleted, Id, EndDateTime, Description, ShowAs, (SELECT Id, Status, Response, EventId, RelationId,…
Abhi
  • 303
  • 2
  • 5
  • 13
0
votes
1 answer

SOQL Salesforce Join and Filter for 3 Different Objects

I would appreciate if someone can help me with the following requirement for building a SOQL. Object1: Event : Fields to get: Id, Subject, OwnerId Object2: EventAttendee : Fields to get: EventId, AttendeeId Object3: User : Fields to get: Id,…
Abhi
  • 303
  • 2
  • 5
  • 13
0
votes
1 answer

SalesForce get list of Contracts for Account

My php client connects to salesforce using their SOAP API ( partner.wsdl ). After getting a list of Accounts, I also want a list of all the Contracts for each Account. Since SOQL doesn't allow join statements, the only way I see is to first get a…
NoodleFolk
  • 1,949
  • 1
  • 15
  • 24
0
votes
1 answer

Is there a way to group by the date portion of a datetime field in SOQL

select day_only(createdDate) createdonDate, count(createdDate) numCreated from account group by day_only(createdDate) order by day_only(createdDate) desc this soql return result count base on day. but i want result count base on…
Arjun patel
  • 15
  • 2
  • 8
0
votes
1 answer

Salesforce - Correct way of login/logout java API

I have an java application that interacts with Salesforce. Application processes a batch of requests (~100 requests). Before starting processing of each batch, it calls login() to Salesforce but it never calls logOut() from it in the end. Same cycle…
RandomQuestion
  • 6,778
  • 17
  • 61
  • 97