Questions tagged [count]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
0answers
19 views

Row count result from SELECT COUNT() not matching rows returned by SELECT id [duplicate]

Fairly new to SFDC and primarily using it as a source for our data warehouse. We're ingesting data using the Bulk API and are manually checking rowcounts through workbench. Running into an odd issue ...
1
vote
1answer
27 views

SOQL Get child with most rows grouped by parent

Let's say i have the following structure Object Car is a parent of many (object) Incidents that are also children of an Area So the table of incidents looks like this INCIDENTS ID CAR AREA ...
1
vote
1answer
81 views

SOQL: Aggregate, Grouping By and WHERE Clauses not working

This query SELECT Reason, COUNT(Id) FROM Case WHERE RecordType.DeveloperName = 'Problem' AND AccountId = 'xxxx' AND GROUP BY Reason is giving me Unknown parsing error: But when I run the ...
0
votes
1answer
82 views

GTL counting Json string

I have set up a GTL and AMP script that looks at my attributes where i passed in a Json string (array). This is the string: `[{"MiddleName":"der","LastName":"Test"},{"MiddleName":"van der","LastName"...
1
vote
1answer
107 views

Can the Process builder, count the number of instances and then execute a certain task

Process automator can be used to automate a lot of things within salesforce. For one such scenario can I use it to count the number of instances of a certain object and then set a checkbox value to ...
1
vote
0answers
57 views

Marketing Cloud Integration: Count Individual Email Results

I built a very simple rollup for the email results from Marketing Cloud. It seems to work fine until bulk emails are sent out. I thought I had built the code to handle that fine, though. Here is the ...
6
votes
2answers
877 views

Count Lines of Code Excluding Comments

Does anyone have a script which can count the lines of apex code excluding any commented lines? Thanks!
0
votes
1answer
170 views

Count the number of details in master-detail relationship

How can I count the number of details in master-detail relationship? Let us suppose I have Detail_Type__c and Master_Type__c. Now if I have and Id of a Master_Type__c record I can do the following ...
4
votes
1answer
85 views

SOQL Count() limits

Summer '18 changed Count() impact on query row limit from "number of records matched" to 1. Is there still some form of a limit, like selectivity criteria related limits, or can an arbitrary number ...
2
votes
1answer
89 views

Do custom metadata types not support COUNT(fieldName) with a GROUP BY?

Question title covers most of it. Here's a sample query and the error I receive in response: SELECT COUNT(Id) FROM MyCustom__mdt GROUP BY MyField__c field Id does not support aggregate operator ...
0
votes
1answer
46 views

Rollup Help needed

I am using a tool called "Declarative Lookup Rollup Summaries Tool" by Andrew Fawcett in Salesforce Enterprise Edition. I have a sales team that makes outbound calls. I am looking for a way to count ...
1
vote
1answer
334 views

Variable does not exist opp.Id - How to pull a count from a SOQL query and set to a variable?

I have an APEX class with a controller extension. This extension pulls in child Service records on a related Opportunity. If you look at the getServices list, you'll see it references opp.Id. This ...
1
vote
2answers
420 views

SOQL Conditional Counting?

I am trying to run a query that will return counts of the different Opportunity Record Types for each user during a particular month. My query currently looks like this: SELECT Owner.Name, COUNT(...
0
votes
2answers
80 views

how to notify by email if account owner owns more than 100 records in salesforce

Please can anyone suggest me on how an admin can be notified by email if account owner owns more than 100 records. I've created a report to get the record count for each account owner. Then in order ...
1
vote
0answers
75 views

How to display Day Counts Timer on Case Object?

I have a requirement where I want to display no of days when Case is opened. Days should count only when Case Status is 'New','In Progress' or escalated. IF the case status is Pending with Business ...
-1
votes
1answer
434 views

Executing List of soql count() queries in apex class

I've a Map of SOQL count queries, is there any way to execute the whole list(Map Values) of queries and get result in to a map. Map<String,String> countQueryMap=new Map<String,String>(...
0
votes
2answers
216 views

COUNT(*) have null value in column - SQL

I am trying a query SQL in Salesforce to count the number of click per user on one link. However, the count column stays empty even tough my query looks good from a syntax point of view. Here is my ...
0
votes
2answers
46 views

How to query and display an aggregatedlist SOQL Visualforce

I'm a complete newbie at salesforce and have spent hours trying to figure this out with no luck (so far)! The schema is fairly simple: (Objects are bold) There are Teachers (contact record types) ...
0
votes
1answer
370 views

Account and Contact Object have Lookup relationship

Account and Contact Object have Lookup relationship. There are two requirements: To display the count of Contacts into the Account Object. So I have created the trigger for it and now it is ...
1
vote
2answers
260 views

count only case related tasks

In this below query I want to get all the tasks related to a contact, related to a case or related to other object. Integer c = [SELECT count() FROM Task WHERE ...
1
vote
3answers
2k views

Query Data Extension count

I have an idea I hope you'll help me set up. I want to count the number of records in a data extension and write the count into a new data extension called DataExtensionCount. I want to count records ...
0
votes
0answers
35 views

count function is not giving correct total count in soql query

I am using below query to count the records based on the status field and grouping it's using one more picklist field. i am getting correct count respective to the individual picklist field but the ...
-1
votes
3answers
706 views

Issue in trigger for count of records in look up relationship

I have two custom obj, Parent__c and Child__c with a Lookup relationship between them. I'm just trying to count the Child records via trigger, but I'm getting error when i create a new child record ...
1
vote
1answer
456 views

Dynamic Apex:Repeat size (adding rows)

I've tried to make a button that would add another row to apex:repeat that has couple apex:inputField fields in it, but with no success (i'm getting "Attempt to de-reference a null object" error) I'...
0
votes
3answers
447 views

Contact Count Trigger

I am not getting any errors with the below code however, after doing some testing I found that recalculation is not taking place when a contact is deleted and field "Number of Contacts is not updating....
0
votes
1answer
105 views

System Query Exception: Aggregate Query

I am getting the following error for my contact count trigger below. I am not sure what this error means. It only affects 2 out of 300,000+ accounts in my org. Error: Invalid Data. Review all ...
1
vote
2answers
2k views

How to count the number of children accounts a Parent account has [closed]

I am having trouble figuring out a way to create a field within the Account Object that counts the number of children each parent account has. I can't use a simple roll-up summary field because the ...
4
votes
1answer
3k views

How to get exact record count for an Object using SOQL for more than 1 million record

I would like to know how many records are there for a given Object. I have written code (SOQL) which can show record count for <= 50000 records but I have 2 Million records then how can I get an ...
8
votes
2answers
2k views

Fastest way to count large numbers of records in APEX?

I am migrating records to Salesforce.com, and therefore need to check total record counts frequently. Some objects have over 500,000 records. The simple 'Count' functions max out at 50,000 records ...
0
votes
1answer
45 views

Lead Count for every 10mins [closed]

I have a requirement . I want to know the number of leads created for every 10 mins and if the leads are not created in last 10mins I want to get an email saying No leads are created in last 10 mins ...
0
votes
1answer
691 views

Count records in QueryLocator?

For counting recording of an sObject I would write ... Select count() from obj; But how do I find out the total records in Database.QueryLocator?
1
vote
1answer
504 views

Using Count function in SOQL and If condition

I am updating a value on related record based on the count of another record. The condition is say A is lookup to B record. So, if there is only one B record then certain Value of a field say C on B ...
0
votes
1answer
311 views

Can I count “Calls” on Contacts associated with an Opportunity?

We had an existing TaskTrigger that counted "completed calls" on Leads which was pretty straight-forward. I modified the code and now it counts "completed calls" on Opportunities. Our sales manager ...
1
vote
1answer
2k views

count of all Sobjects Record in salesforce org

I wanted a query to get data volume of all objects in sales-force. May be a count of all object's record at once. I know I can do it by Count in workbench. But I have to do it for all objects. So is ...
1
vote
1answer
334 views

How does the API count increase when i uses a REST API

How does the API count increase when i use a REST API. I have a REST API apex class to insert records into a custom object, and I am trying to figure out how many API calls it takes to process one ...
1
vote
0answers
64 views

Filter Count on each SOQL Data Category Passed to Query

I have the following query that returns the total count: SELECT Count() FROM X__kav WHERE PublishStatus = 'Online' AND Language = 'en_US' WITH DATA CATEGORY Foo_c AT (Bar_c, Baz__c) How would I ...
1
vote
1answer
97 views

Count Distinct Records based on the Composite Key from one table and update the count in different table in Salesforce

I am trying to count distinct records from one table and update the count in different table: Account has relationship with table A Contact has relationship with table B. On Table B we have columns ...
0
votes
2answers
541 views

Dashboard- To display how many new records are made

Is there a way to display reports in a seven-day week format? Example: Monday - 100 records Tuesday - 60 records etc.. until Sunday To be displayed in bar chart. Is COUNT possible for ...
4
votes
2answers
2k views

What is the coalesce() eqivalent?

Much like this post here: SOQL: Avoid count with NULL results return 0 (zero) instead I have an instance where I am using aggregate functions like COUNT() and MAX() on a collection of Opportunities. ...
2
votes
1answer
1k views

long text area ( formula )

I am trying to find number of lines of long text area field using (formula).As formula field doesn't supports long text area workaround is to use workflow field update formula(workflow field update ...
0
votes
2answers
129 views

Why doesn't 'SELECT count() from OauthToken' work?

Following two queries don't work for me: SELECT count() from OauthToken SELECT count() from ThirdPartyAccountLink I get the following: UNKNOWN ERROR: UNKNOWN_EXCEPTION: An unexpected error ...
0
votes
1answer
1k views

Count number of child records using SOQL Aggregate

I am new to this and I hope someone can help me with this. What my aim is to count the number of AVTRRT__Job_Applicant__c records with a date value on Last_Activity__c field on ...
2
votes
1answer
516 views

Grouped Query Cannot Use Child Relationship in Remote Action Apex Class

I am trying to count the number of account names that occur in my soql statement. Ultimately I have a map that shows all of the accounts near a technician and I want to show the number (count) of ...
2
votes
2answers
4k views

SOQL Count distinct occurrences in column

I have to pull data from a Salesforce database and get a count of the number of times each category appears. Currently, I have it pulling a list of the categories and then I use a perl script to ...
4
votes
1answer
751 views

Display a count of records within 15 miles of a subscriber ZIP code

I have an ExactTarget question. I have a data extension of _subscribers. One of the fields is their zip_code I have another data extension of _widgets which includes the widgets' zip_code1 I also ...
1
vote
1answer
579 views

AggregateResult Count help

Sorry to bother you on a Saturday, but i need some help This is a two part question, so please be patient .I have created a fieldset on the account object called “HistoryTracking”. 1) I would like ...
9
votes
2answers
899 views

Getting record count through WebService bypassing LIMITS

I have written the below web service class to return record count. But it is returning the following message "System.LimitException: Too many query rows: 50001". How could I overcome this limit? @...
1
vote
1answer
200 views

How to do a count of attached opportunites

As above, we have a custom style of Organisation (Adviser) that can be can be linked to opportunities via a lookup function on the opportunity itself. Currently in the adviser org we have a manual ...
5
votes
2answers
2k views

How does salesforce calculate DML rows? What is included to DML Rows Count?

Does anyone know how does salesforce calculate DML rows? What is included to DML Rows Count? Consider following code which hits "System.LimitException: Too many DML rows: 10001" List<...
10
votes
3answers
21k 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. ...