function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LeadforceLeadforce 

Account Question

Question????
A field on an "Account" object that displays a summary count of Records on a Related list object that match a certain field criteria. 
I am trying to figure out how to create a formula field on "ACCOUNT" object that displays a sum/count of Records on a related list object, but only records on the related list object that match a certain field criteria. 

Example.
A lookup relationship exists between "Accounts" and "Assets".  We need a formula/sum field on "Accounts" that adds the number of related "Asset" records which have an "Approved" checkbox field value that equals "TRUE" (or checked).  Thanks!!! 
Balaji BondarBalaji Bondar
Hi ,

You can use standard Rollup field feature with Filter criteria based on your business requirement.
BalajiRanganathanBalajiRanganathan

Standard Rollup summar works only if we have Master Detail Relationship. for Lookup there is no declarative solution.

For Lookup, you can try  this

https://github.com/afawcett/declarative-lookup-rollup-summaries

http://www.sundoginteractive.com/sunblog/posts/rollup-summary-with-a-lookup-field-salesforce