I need to write a validation rule that prevents the user from deleting any pipeline records that they did not create? How can I accomplish this?
[SalesForce] Validation rule prevent user deleting record in pipelines
Related Topic
- [SalesForce] Validation Rule to prevent editing record
- [SalesForce] Prevent user from editing or deleting a validation rule
- [SalesForce] Allow ownership change if a queue owns the record but prevent any changes if you do not own the record
- [SalesForce] Validation rule to prevent creating records of certain record type not working
Best Answer
The only way to validate deletion is with an
Apex Trigger
. To validate a record and prevent its deletion, you need to calladdError
.The most basic working structure would look like:
A few things to note:
Handler Pattern
and/orService Layer
Custom Label
so that it can be configured