Mark Opportunity as Hot for High Amounts

This trigger updates the Opportunity Description to “Hot Opportunity” if the Amount is greater than 100,000. It helps identify key opportunities for follow-up.

For practice, explore this YouTube playlist.

Solution:

trigger OpportunityTrigger on Opportunity (before insert) {
            if(Trigger.isInsert){

                   if(Trigger.isBefore){
                           OpportunityTriggerHandler.updateDesc(Trigger.New);
                 }
          }
}
public class OpportunityTriggerHandler {
        public static void updateDesc(List<Opportunity> oppList){ for(Opportunity
                                opp:oppList){ if(opp.Amount!=null
                                && opp.Amount>100000){ opp.Description=’Hot Opportunity’;
                }
        }
   }
}

Want to Apply As Content Writer?

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart

Let's get you started!

Interested in writing Salesforce Content?

Fill in this form and we will get in touch with you :)