Create a Custom Field on the Account Object “Number of Contacts” with a Number Data Type that does not have any decimal point in it.
Requirement (Roll-up Summary Trigger)
Develop a Solution that will count the related contact related to the Account and store the information in the “Number of Contacts” field.
Note:- The contact can be created/deleted/undeleted and updated from the Account Record. So please keep that in mind
Question?
→ Apex Trigger 10
Prerequisite
Create the Custom Fields on the Account Object “Sum of Closed Opportunity Amount” & “Sum of Open Opportunity Amount” with a Currency Data Type with 2 Decimal Points.
Requirement (Rollup Summary Trigger)
Develop an Apex trigger to SUM the Opportunity Amount of the Closed Opportunity and Open Opportunities. The closed opportunities are the ones with the Status equal to “Closed Won” OR “Closed Lost”. And store the result in the “Sum of Closed Opportunity Amount” & “Sum of Open Opportunity Amount” fields respectively in the related Account for the opportunity.
Note:- The Opportunity can be created/deleted/undeleted and updated from the Account Record. So please keep that in mind
Scenarios for Update DML