#sfdclearn #salesforce #apexTrigger If we have requirement to rollup summary on two level using Apex trigger as below: We have Account as Grandparent Contact as parent Location__c as child When any record inserted / updated or deleted in Location object we need to calculate number of contacts count and calculate number of location count associated with each contact associated with account and update below two custom fields on Account. No Of Contacts (All contact associated with account ) No Of Contact Locations -->(all location count from each contact associated with Account) Please refer below blog post