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
AlexskiAlexski 

Field that counts records from another object

I've built a custom Courses object.  The Courses object has a Course Registration Number field (CRN).

 

I also have a CRN field in my Leads object. .

 

I would like to show the count of related Leads as a field in the Courses object.

 

The syntax would be something like this:

SELECT COUNT('crn') from Leads where Leads.crn = Courses.crn AND Leads.type="max-exceeded"

 

Can I do this through a formula field?  How?  If not, is there another way to do it.  

Steve :-/Steve :-/

It can't be done with a Formula field, but if the 2 objects have a Master-Deatil relationship you can create a Rollup Summary field.