Universal Containers wants to prevent Opportunities from being edited once they reach the Closed/Won stage. To achieve this, the developer can use the following strategies:
Option A: Use a validation rule.
Correct Approach.
Explanation:
A validation rule can be created on the Opportunity object to prevent users from editing records when the Stage is Closed/Won.
The validation rule would evaluate whether the record's StageName is 'Closed Won' and, if so, display an error message when a user attempts to edit and save the record.
Example Validation Rule:
AND(
ISPICKVAL(StageName, 'Closed Won'),
ISCHANGED(ANYFIELD) // Replace ANYFIELD with specific fields if needed
)
[Reference:, Validation Rules, Validation Rule Examples, Option B: Use a before-save Apex trigger., Correct Approach., Explanation:, An Apex trigger can be written to check if an Opportunity record being modified has a StageName of 'Closed Won'., In a before update trigger, the trigger can prevent the save operation by adding an error to the record., Sample Apex Trigger:, trigger PreventOpportunityEdit on Opportunity (before update) {, for (Opportunity opp : Trigger.new) {, Opportunity oldOpp = Trigger.oldMap.get(opp.Id);, if (oldOpp.StageName == 'Closed Won' && opp != oldOpp) {, opp.addError('Closed Won Opportunities cannot be edited.');, }, }, }, , Benefits:, Programmatic Control: Allows for complex logic., Granular Enforcement: Can specify exact conditions under which edits are prevented., Reference:, Apex Triggers, Trigger Context Variables, Options Not Suitable:, Option C: Use an automatically launched Approval Process., Incorrect., Explanation:, Approval Processes are designed for record approval workflows., They do not inherently prevent edits based on a field value like StageName., Option D: Use an auto-response rule., Incorrect., Explanation:, Auto-response rules are used to send automated email responses to Leads or Cases., They do not control record editability., Conclusion:, The most appropriate strategies are A (Validation Rule) and B (Before-save Apex Trigger)., Both methods effectively prevent users from editing Opportunities in the Closed/Won stage., , ]