You need to sign in to do that
Don't have an account?
Rick SF Admin
Custom field that counts and displays the number of records within a custom object
Hi,
I have a custom object (Demo__c). In this object, I would like to have a custom field that would count and display the number of records for this object based on a filter criteria. I know this can be accomplished using Reports but I want a field on the object itself to show this information. For example, the Demo object has 100 records. Of the 100 records, I want to see in this custim field how many records have a total revenue value less than or $1,000,000. If there are 10, then the custom field should show 10.
I have a custom object (Demo__c). In this object, I would like to have a custom field that would count and display the number of records for this object based on a filter criteria. I know this can be accomplished using Reports but I want a field on the object itself to show this information. For example, the Demo object has 100 records. Of the 100 records, I want to see in this custim field how many records have a total revenue value less than or $1,000,000. If there are 10, then the custom field should show 10.
You can try this code:
TRIGGER HANDLER:
TRIGGER:
Hope this explanation will help you.
If you find it helpful, mark it as best answer so that other's also get help from this.
Thanks,
Akshay