How to Calculate Min. & Max. Opportunity Amount Related to an Account using Apex Trigger

We are back again with another solution to ease your Salesforce development woes. In today’s issue, we will share the Apex code to calculate the minimum and maximum opportunity amount related to an Account. Follow through the steps below to learn how you calculate the Min. & Max. Opportunity Amount Related to an Account using Salesforce Apex Trigger.

Let’s begin.

Step 1

Create two Fields on the Account object on which we want to get the minimum and maximum value amount of the opportunity in our case we created Min and Max.

Step 2

Open the developer console or your choice of IDE to develop the Apex trigger.

Step 3

Write the Apex code as follows

Code

Conclusion

We hope this interests you! Feel free to try the Apex Trigger code to calculate Opportunity Amount Related to an Account in Salesforce. Also, do not forget to check out our tutorials section to get your hands on many such interesting Salesforce development solutions. Stay connected!!

Our Location worldwide
India
3rd Floor, A-10, Pegasus Tower, Sector 68, Noida, Uttar Pradesh 201301 +91-1203117884
SR Tower 2nd Floor Hydel Gate Haldwani Uttarakhand 263126 +91-5946359996
USA
333 West Brown Deer Road Unit G – 366 Milwaukee WI, USA 53217 +1(262) 310-7818
UK
7 Bell Yard, London, WC2A 2JR +44 20 3239 9428
Canada
HIC Global Solutions INC
43 Lafferty Lane, Richmond Hill, L4C 3N8, CA +1(262) 310-7818