Questions tagged [count]
The count tag has no usage guidance.
73
questions
0
votes
1
answer
74
views
How to sum the values of an aggregated query
I have a parent object Account with related contacts these related contacts have (several) related statuses i.e. A B C. These are all the statuses a contact has had.
On the parent Account I need to ...
0
votes
2
answers
127
views
How do I include a COUNT field in SQL with multiple joins?
I have a SQL where I want to pull in all Landlords with more than one Pending Request. The trouble I'm having is not knowing where to place the syntax that will populate the field called '...
-1
votes
1
answer
762
views
User Object Field Formula to count # of assigned contact
I was hoping you can guide me to a formula WITHOUT using rollup summaries in the User object.
Note: I cannot create rollup summaries because it's not a master record detail. It wont allow me.
...
0
votes
1
answer
19
views
I am getting these error while executing in anonymous window
public class wordCounter {
public void submit(string[] args){
String s = 'Big black bug bit a big black dog on his big black nose';
List<string> a = s.split(' ');
Map<...
0
votes
1
answer
377
views
Flow - Count checkbox true and attached files
Ive created a flow that only allow users to attached files according to the number of checkbox.
If i got 3 checkbox true, i would like found 3 files on the record.
For this, ive created a formula ...
-1
votes
1
answer
2k
views
How to just show subtotals for each column in a report?
I'm having trouble doing something supposedly very simple, can anyone tell me how I can display the record count for each column in a report?
Knowing that each column is a picklist field that can have ...
-1
votes
1
answer
313
views
Search items from list and get count [closed]
I have a list of accounts from SOQL as below:
List<Account> accList = [Select ID, Name, MyField__c From Account where course__r.status = 'active'];
I have added the values of MyField__c from ...
1
vote
1
answer
2k
views
How to write SOQL query in Salesforce to get total row/record counts of each object along with the object name?
SELECT qualifiedapiname
FROM EntityDefinition
WHERE IsQueryable = true
AND IsRetrieveable = true
AND IsDeprecatedAndHidden = false
LIMIT 2000
Above query lists all SFDC standard/custom objects....
1
vote
2
answers
511
views
How do I display multiple badge-count in lightning-vertical-navigation?
I need to do something like this:
I'm not sure if lightning-vertical-navigation-item-badge is used here, because I don't know how to add a second badge-count. That's what I have at the moment. Any ...
0
votes
0
answers
77
views
Apex trigger not step in isUpdate
In the following apex trigger it does not step in isUpdate. It works properly in case of new insertion or deletion, but in case of update it does not removes the old ID from the list. As per the debug ...
0
votes
1
answer
2k
views
Count activities on contact object
Is it possible to create a rollup summary field on Contact to count the activities. For example, count the total number of times 'Log a call', total number of times 'log a meeting', and total number ...
0
votes
1
answer
76
views
Trying to count Jobs under an account, which stage is open
I am trying to write a trigger, which counts the number of open jobs under one account. I am just a begginer and the code I made is based on a similar trigger for tasks.
I get the following Error ...
0
votes
1
answer
534
views
count numbers of orders using ampscript [duplicate]
In SFMC, I need to show a specific block at the 1st order and after that it needs to be displayed at every 4th order. Meaning 4+1 (5,9,13 and so on). My current ampscript looks like this, but I am ...
1
vote
2
answers
465
views
create a report to show which new users have less than 2 child records
Let's say we have a custom object called 'Business Reviews' (BRs) which has a lookup (Consultant__c) to User.
Now would like to have a [lightning or classic] report that can show all users that were ...
0
votes
1
answer
490
views
Trigger with count SOQL
I need to count how many fields were populated in a lead, every time a Lead is created.
I'm using the count() statement, to query the fields that need to be counted.
In the trigger, the following code ...
0
votes
1
answer
193
views
Implementing Visualforce page view count using javascript and updating the count in custom field
Hi We have two fields created for reporting and administrtion purpose.
Product_Book_View_Count__c
Product_Book_Download_Count__c
We track how many time a user is visiting the record and updating the ...
0
votes
1
answer
186
views
Issue with file count on Custom object
I have an apex class which updates the files count on custom object called Declined_Policy__c.
Below is my apex class:
public with sharing class Policy_FileCountClass {
public static void ...
0
votes
0
answers
778
views
Need a flow to output number of unique values on a related list
I have a custom object called "Issue" with a related list to another custom object called "Impacted Contacts." There's a join record called "Issue Impacted Contacts." I need to make a flow that will ...
1
vote
1
answer
2k
views
Counting RecordType records
I am using simple_salesforce in Python3 to send query_all() SOQL queries against the REST API.
Now:
sf.query_all('SELECT Id FROM RecordType') returns 53 records.
But:
sf.query_all('SELECT COUNT(Id) ...
2
votes
2
answers
3k
views
How to retrieve total number / count of records stored in Big Object?
Even this seemingly easy task is impossible to do.
For some reason, even when I loaded millions of data into Big Object, it somehow isn't reflected in
Setup > Storage Usage
Given sometimes it ...
1
vote
0
answers
508
views
SOQL Count query on large number of records
I am attempting to run a count query in workbench(and dev console). I am simply trying to count the number of records within the object(with 2 where statements). My estimation is that there is ~28 ...
0
votes
2
answers
305
views
count the ocurances of a value in a list at js controller lightning
Below is my list, and i would like to count the string and keep it in map
count==>["Vendor Master","Vendor Master","Customer Master","Customer Master","Customer Master","Customer Master","Material ...
2
votes
0
answers
46
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
1
answer
506
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
1
answer
3k
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
1
answer
374
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
1
answer
2k
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
0
answers
781
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 ...
8
votes
3
answers
6k
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
1
answer
1k
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 ...
5
votes
1
answer
2k
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 ...
3
votes
1
answer
1k
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
1
answer
118
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
1
answer
1k
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 ...
2
votes
2
answers
755
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
2
answers
164
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
0
answers
440
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
1
answer
2k
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
2
answers
536
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
2
answers
94
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) ...
1
vote
2
answers
1k
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
3
answers
5k
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
0
answers
97
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
3
answers
2k
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
1
answer
824
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
3
answers
1k
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
1
answer
305
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
2
answers
5k
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
1
answer
6k
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
2
answers
4k
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 ...