User Story
As a sales manager, I want to ensure that Opportunity records cannot be edited once they have been closed as either won or lost. This will ensure that important sales data is not accidentally altered, providing accurate historical data for future analysis.
When a user attempts to edit an Opportunity record, a trigger should be fired on the Opportunity object. The trigger should first check if the Opportunity Stage is set to either 'Closed Won' or 'Closed Lost'. If it is, the trigger should prevent any further edits to the Opportunity record and display an error message to the user informing them that Closed Opportunities cannot be edited.
If the Opportunity Stage is not set to 'Closed Won' or 'Closed Lost', the trigger should allow the edit to proceed as normal.