Salesforce uses Sales Cloud to track opportunities throughout the sales pipeline. The sales team categorizes opportunities into various stages, such as Prospecting, Negotiation,Closed Won, Closed Lost and many more.
For reporting and analytics, the management team needs a mechanism to quickly verify if an opportunity has reached its final stage.
The final stages of the opportunity are quite dynamic and vary depending on the record type. The Salesforce team has decided to use an apex method to determine whether the opportunity is in the final stages.
Complete the given apex method to return a boolean value to verify if the opportunity is in final stages.
Instructions :
1. The method should accept a list of final stages and current stage as input parameters.
2. If the current stage name is in the list of final stage, return true. Otherwise, return false.
Example:
//Assume current stage is 'Closed Lost'
//finalStages contains both 'Closed Lost', 'Closed Won'
Boolean isFinalStage = opportunityStageController.isFinalStage(finalStages, currentStage);
//Result
//The isFinalStage is true
Hint:
Use apex list methods to find if the current stage name is belongs to final stages date.
Click here to view all apex list practice examples