In this post, we will discuss how to work with apex trigger and logic building.
Below is the Agenda for the video
Problem Statement
Possible Solution
Choosing the right solution
Solution Approach
Develop the Apex Trigger
Assignment – Create a Custom Field on Contact (Amount) and another Custom Field on Account(Sum of Contact Amount). Develop a trigger to Sum the Amount on Account object using any Approach discussed in Video
Amit Singh aka @sfdcpanther/pantherschools, a Salesforce Technical Architect, Consultant with over 8+ years of experience in Salesforce technology. 21x Certified. Blogger, Speaker, and Instructor. DevSecOps Champion
How to handle account changes (line 28) if we are using Handler Class?
That is already taking care of.
Can u provide a test class for this trigger also for the solution 1?
I am sorry, You have to develop the test class and if you stuck anywhere I can help there.
can u provide a test class for the trigger solution 1 also ?
I am sorry, You have to develop the test class and if you stuck anywhere I can help there.
Hi Amit ,
I think Solution # 3 might have an issue in a scenario where all the Contacts from Account 1 are moved to another Account 2 . In this case , Account 1 might not get stamped with 0 value in Solution # 3 .
Thanks Amit ,
How to handle account changes (line 28) if we are using Handler Class?
That is already taking care of.
Can u provide a test class for this trigger also for the solution 1?
I am sorry, You have to develop the test class and if you stuck anywhere I can help there.
can u provide a test class for the trigger solution 1 also ?
I am sorry, You have to develop the test class and if you stuck anywhere I can help there.
Hi Amit ,
I think Solution # 3 might have an issue in a scenario where all the Contacts from Account 1 are moved to another Account 2 . In this case , Account 1 might not get stamped with 0 value in Solution # 3 .
true and that is not the recommended solution 😀