A Salesforce Object Query Language (SOQL), modeled on SQL, for accessing information saved in the Salesforce database.

learn more… | top users | synonyms

2
votes
0answers
9 views

SOQL query with carriage return in field

I'm trying to issue a SOQL query where one of the WHERE clauses is for a filed that contains a carriage return. The following query doesn't work. I've tried \r, \n\r, \r\n and \n, but none of them ...
1
vote
0answers
20 views

SOQL Limit Reached

Can anyone help me with why i am reaching the limit with this. Error Message: System.LimitException: Too many SOQL queries: 101 Stack Trace Trigger.FirstInvoiceBeforeWithType: line 41, column 1 ...
1
vote
1answer
23 views

Descending Table With Two Objects

I have a table that lists out two different objects in descending order. The issue is that the list is returning all of one object and then all of the second object. It is still in one table but the ...
3
votes
2answers
37 views

How to find parent records with only 1 child record

I want to pull all the parent records which have only 1 child record either using a query or report or any other way. For example all the accounts with only 1 contact record. I don't want to create ...
1
vote
1answer
18 views

Filter ProcessInstance by Id Type

I'm writing a short snippet of code to get which records of a certain type were approved, and by who. However, I don't have an id list- I have an sObject type. I know I can filter the id values after ...
1
vote
1answer
46 views

System.LimitException: Too many SOQL queries: 201

I know that this error is fed up, but i'm really doesn't know what i'm doing wrong? So the process: The batch starts every day and checks the value of FirstDateOfMonth__c = Today() and update the ...
2
votes
0answers
26 views

What's causing this large delay between entering a package and running a trigger?

A client has recently come to me with a performance issue with my managed package. He is running a test operation which causes a trigger in my package to run but when it does, the maximum CPU time ...
1
vote
2answers
38 views

Relationship problems in DML/SOQL

I am unable to understand relationships with DML/SOQL. Example, I have custom objects Course__c and Course_line_item__c. Course_line_item__c has a lookup field on it that points to Course__c. So this ...
1
vote
3answers
53 views

Get a value from SOQL query into string

Quick Question, I have an soql query that looks like this: List<Service_Instance__c> Servic = [Select Account__c, Account_Customer_Account_Number__c, Airports__c, Local_Service__c, Location__c,...
3
votes
1answer
54 views

SOQL Performance : LastModifiedDate vs SystemModStamp

From Force.com SOQL Performance Tips: LastModifiedDate vs SystemModStamp: However, the query optimizer cannot use the index if the SOQL query filter uses LastModifiedDate to determine the upper ...
2
votes
0answers
27 views

Query results in Query Editor are different then Degbug Log Results

When I query ActivityHistory in my SOQL editor, I get back the correct results with the correct format of the activity date: [{"CreatedById":"00534000009QnEtAAK","Subject":"Call","Description":"this ...
2
votes
3answers
22 views

Find EmailTemplate Used in EmailMessage

Is there a way to find out if/what emailTemplate was used on an outbound EmailMessage? Looking in Eclipse I cannot see any relationship between the two (or in the schema builder tool), nor a field on ...
1
vote
1answer
36 views

Retrieving objects through soql queryin salesforce [closed]

Is it possible to retrieve all the objects present in my org using a query?
0
votes
1answer
17 views

How to use contentType field in CollaborationGroup standard object?

I have using this soql query: select Id, Type, ParentId, Body, LinkUrl, ContentType,CreatedDate, CreatedBy.Id, CreatedBy.Name, RelatedRecordId FROM CollaborationGroupFeed Here Content Type is ...
1
vote
0answers
14 views

Unable to retrieve Quote templates and Products information in salesforce developer sandbox

We are installed Zuora in our organisation. There are two applications called Z-force quotes & Z-force 360 packages.When to try to create a quote in developer sandbox.I unable to retrieve Quote ...
1
vote
0answers
23 views

How to update a field based on particular picklist value

I got a requirement like I have checkbox called reworked in opportunity page.Whenever stage changes from closed - lost to any value.i have to update the checkbox automatically. Is there any ...
0
votes
2answers
25 views

query with a reference condition

I have a query inside a trigger and one of the conditions is that a reference field (lookup) is not null. My query is: List<Contract> contratti=[Select Id,Opportunitl__c from Contract ...
0
votes
1answer
18 views

Sales force Event Log File shows only logout and URL event types?

Salesforce Event log file only showing log out and URI Event Types. All Event Types are not showing up in Event Log File query. QUERY: SELECT EventType FROM EventLogFile OUTPUT : **EventType** *...
0
votes
1answer
18 views

display aggregate result value as currency

I have requirement to display aggregate result values in visualforce page and it should be formatted to currency. Could anyone help me with this issue i am facing. apex controller: RepSalesbyFund = ...
0
votes
1answer
28 views

Database.Query() method casting issue

I am trying to re-word this code in a custom controller: public Double getFebruary() { Double amountX = (Double)[SELECT SUM(Amount)amt FROM Opportunity WHERE RecordTypeId =:oppNBRecordTypeId AND ...
4
votes
1answer
256 views

Governor Limit on number of child records fetched

A SOQL query can return a maximum of 50,000 records, is there any limit on the number of child records that can be fetched in a SOQL query. Example, I have an Account name as 'DBZ' having more than ...
0
votes
1answer
23 views

SOQL join between custom related Objects and standard Objects

I have to retrive datas from 2 custom object and sobject Product2, Object details as follows, object name :delv__dftly_Delivery_Checkouts__r Field name API Name Data type ...
0
votes
0answers
18 views

SOQL join between child-parent custom related Objects and standard Objects

I want to retrieve data from 2 custom Related objects(delv__dftly__tasks__c and delv__dftly_Delivery_Checkout__c) and Sobject Product. for which I tried join SOQL query as below, relationships as ...
1
vote
1answer
25 views

ContentDocument parentId

I am uploading a file via the Files related list on the Contact detail page. When I query (SOQL) the database I see the relevant ContentDocument and ContentVersion records. I would like to get the ...
0
votes
0answers
30 views

@ReadOnly thorwing System.LimitException: Too many query rows: 50001 error

I have nearly 300,000 account records in my org. I have the following class in my org: global class testReadOnly{ @ReadOnly webservice static List<Account> getAcc(){ return([...
3
votes
2answers
51 views

SOQL - aggregrate checkbox fields

Need some SOQL help. How can I get back a nice list of counts for each checkbox fields. Example: Select CheckField1,CheckField2 FROM Account_Counselor WHERE User = '123..' This will currently ...
3
votes
2answers
74 views

SOQL Issue Passing In AccountId

I believe it is my SOQL query that is giving me an issue. I need to take all of the notes and tasks (from the account that wrote them) and list them back out on the Account Page with a custom VF Page. ...
0
votes
1answer
21 views

How to assign leads to a campaign through automation

Hi friends I'm new to campaigns.I got a requirement like whenever any lead is created with specific field value in a custom field.I have to update in a particular campaign. Requirement is I have ...
0
votes
1answer
20 views

Writing custom Api methods to access salesforce data in IOs salesforce Mobile app. [closed]

I want to write some Custom methods to access the salesforce data in IOS mobile App. I am new with salesforce Mobile. I have Installed Salesforce IOS SDK , But I am not aware that how should I write ...
0
votes
1answer
29 views

FATAL_ERROR|System.LimitException: Too many callouts: 101

I am trying to do a batch update that enters geocoordinates for 2000 records of a cuctom object called Property__c without gecoordinates using the following code: Batch global class ...
1
vote
2answers
25 views

Limit results from subquery based on parent field

I'm trying to find the value of a specific field at the end of the month on the month someone subscribed. I'm having trouble with the where clause in the subquery. Adding a function on a field from ...
0
votes
1answer
23 views

How to assign case comments to a existing case

i got a requirement i stuck in a place. My requirement is We have a email to case option available in sfdc. So, case has been created in sfdc. But once support executive got a resolution for the ...
2
votes
2answers
13 views

Is there a way to export query editor query results to a file? [duplicate]

Is there a way to export query results from the query editor in the developer console to a file?
1
vote
2answers
24 views

How to Display Integer value got from SOQL Query (Apex Class) to Visualforce Page

I am new to Apex and trying to access the value from Custom Controller having SOQL query and show it on visualforce page as an Output link. Visualforce snippet: <div class="count"><apex:...
1
vote
2answers
108 views

Too many SOQL - Need advice!

So, I ran into a fun problem this morning. I have added a few new things to a trigger and am now getting the dreaded "Too many SOQL Queries" error. I inherited this code. It was originally created ...
1
vote
2answers
46 views

How to write a Inner SOQL Queries to Orderby Lastmodified date

In the Opportunity object we have Related Lists like Team Members and Open Activities. I want to get fields like Team Members role = 'AB' along with the open activities details from same opportunity . ...
5
votes
2answers
92 views

How to perform Soql query outside for loop?

I am inserting the opportunity line item based on the values of custom object. I am able to achieve this if I add the soql query inside for loop.But that is not an optimized solution. Can anyone ...
1
vote
0answers
41 views

Too many SOQL queries error on apex class

I have the class below getting data from a trigger (that seems to be working ok), the problem is, I am getting a "Too many SOQL queries" errors when it executes. If I comment out "insert ...
2
votes
2answers
40 views

How to calculate how many days probability of each stage avilable [closed]

I want to how many days an Opportunity record resides in each stage. When prospecting to either Closed Won or Closed Lost. Is there better way to count the number of days for a single stage? We need ...
2
votes
3answers
58 views

In SOQL, Difference between passing list of id or List of sObject in WHERE IN clause

List<Account> accountList = [SELECT Id FROM Account WHERE BillingCity='Pune']; List<Id> accountIds = new List<Id>(); ...
1
vote
1answer
38 views

soql not returning results when using apex variables

I am trying to query a custom object using two variables. I used the following piece in my apex code and looked at the logs in dev console id Pgm = 'a1Tm0000000DtjIEAS'; public list<Phone__c> ...
1
vote
1answer
22 views

How to get org defaults custom settings with SOQL

I am developing custom button, I use ajax tooklit for getting some data, needed as url parameters. As part of it I want to query custom settings, but org defaults only. var token = sforce.connection....
1
vote
1answer
21 views

Soql - single record - illegal assignment from list to date

Ok, I have run into this before and I know it is simple but I can spot my mistake. date lastFullReviewDate = [Select Session_Date__c FROM Employee_Session__c LIMIT 1]; Thanks ...
2
votes
1answer
56 views

SOQL - Most recent date that is less than today

How would you go about getting the most recent date from a set of records that is less than today? Example: Record_1 = 1/1/2016 Record_2 = 2/1/2016 If you did a soql like: Select Id FROM Object ...
10
votes
1answer
287 views

Obtaining Single Record - SOQL vs. Instantiating New Object

Background I have a custom object which has a master/detail relationship to Opportunities. Whenever a record on this custom object is created or edited, I need to update the parent opportunity (and ...
3
votes
2answers
69 views

Catching Limit exception rows

i want to catch the limit exception, but I do not how. This is my code: queryCount = 'SELECT count(id) result FROM Product2 '; queryCount = queryCount + getWhereClause(); results = database.query(...
0
votes
1answer
23 views

How to get name of the approver in Email template

Hi friends i'm new to approval process. I stuck in a place where i need to send an email to the sales rep with either approved or rejected with whom approved or rejected. I had created a email ...
1
vote
1answer
32 views

convert aggregate result to list

I'm passing a list to a serialize JSON string value back to a Visualforce page. Traditionally I can easily pass back a List to the JSON. However, my SOQL is an aggregate. I need to be able to ...
0
votes
1answer
31 views

count and update no. of record in another object

There is a lookup relationship between two object CountParent__c and CountChild__c. CountParent__c object contains a custom field called NoOfChildRecords__c which will count the no. of CountChild__c ...
3
votes
2answers
124 views

Getting relationship error for a SOQL

I am getting below error. Didn't understand relationship 'Invoice_CU__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the ...