The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
1answer
52 views

Display the related aggregated value on a VF page

We have a custom VF page that we use in our Org for time entry, and on that page employees select a project, iteration, and enter their time for that week. Note: some employees might be working on ...
4
votes
3answers
71 views

How to use Count() in SOQL

I have a custom object. This custom object has a field Cabin_Type__c, which has values of Twin and Luxury. There is another field Deck_Type__c which is just the number of the deck such as 1,2,3,etc. ...
5
votes
1answer
103 views

Reference fields on parent object in aggregate query

I am trying to run a group by query in Apex where I am grouping by a field on a lookup object. For example: SELECT Account.Type, count(Id)FROM Opportunity GROUP BY Account.Type I can run this from ...
7
votes
2answers
127 views

Can I assign Aggregate SOQL Result directly to variable?

Salesforce documentation suggests that aggregrate soql results must first be assigned to an instance of the AggregateResult class, as shown below: AggregateResult[] groupedResults = [SELECT ...
3
votes
0answers
75 views

Echoing the Counts of each record through PHP using SOQL and GROUP BY

To start, this is the query: $query = "SELECT LeadSource, COUNT(id) Total FROM Lead WHERE CreatedDate > 2013-08-26T00:00:00Z AND CreatedDate < ...
1
vote
1answer
58 views

Aggregate information from multiple contacts into an account

is it possible to create a custom object which will take information from all contacts under an account and aggregate information into that account record? Here's what i'm trying to do specifically... ...
4
votes
1answer
112 views

Efficient way to perform grouping without using aggregate SOQL queries

I have an aggregate query that groups my custom object records by 4-5 fields and then returns a sum of currency fields in each grouping. I have multicurrency enabled so this sum of the currency field ...
1
vote
1answer
313 views

SOQL aggragated query for unique values

I have an object which captures searches made by users. It has a Searc_Phrase__c field. Each record captures one search attempt - the phrase, the use id and the date. I want to query how many times ...
5
votes
1answer
86 views

Aggregate query fails when MyField__c exits in both package (NS_MyField__c) and customer org (MyField__c)

This is really a strange bug. Inside my managed package I have a NAMESPACE_CustomObject__c with a NAMESPACE_CustomField__c. In one of my packaged classes I have an Aggregate Query String soql = ...
3
votes
1answer
597 views

Too many SOQL queries: 101 in apex class. How to count results?

List<tempcon1> listoftemp; CheckContactController chk = new CheckContactController(); public List<tempcon1> getconValues() { listoftemp = new List<tempcon1>(); for ...
4
votes
3answers
1k views

SOQL aggregate query limit

I'm trying to use aggregate queries to save work and script statements. The object has a field for each month representing energy usage for that month for a building. In situations where a building ...
3
votes
2answers
200 views

What makes a field not groupable

I'm trying to use an aggregate query, but one of the fields I want to group by is not groupable (saw it in the soql error and then verified groupable=false in the metadata). It's just a number field ...
0
votes
1answer
329 views

How can i get the id of the max record?

Here is a situation where i need to get the last date of apppointment for a contact and i also need the id of the last appointment date. All appointments are stored in custom object and has a lookup ...
3
votes
4answers
997 views

Non-selective query against large object type in trigger

The Alert__c object has a Rule ID field, which is just text, and a lookup to the Master__c object. I have a trigger on Alert__c, which when runs after insert, update or delete. It collects the Master ...