Salesforce Fact #634 | Validation on opportunity deletion
Suppose we need to keep a validation on Opportunity, an opportunity cannot be deleted if it has existing line items.
We can make use of the HasOpportunityLineItem field in trigger.
Attached is the screenshot.
Note: The code snippet is only for demonstration purpose and apex best practices have not been covered.
Comments
Post a Comment