Most of you would have thought an option to handle before record deletion via out of the box to perform some kind of updates as requested by business.
Earlier we have to write Apex to handle this scenario, now from Winter 21 release , you are getting an out of the box option to configure a new record-triggered flow to run before a record is deleted.This autolaunched flow runs in the background and updates related records when a record is deleted.
Lets see how we can create this flow
When creating a flow, select Record-Triggered Flow.
Select A record is deleted and you’re ready to build the flow.
A sample scenario would be if you need to send email alert for a user of any particular record gets deleted, it can be configured in three simple steps as follows.
Once the trigger is selected, choose the object based on which the flow needs to be autolaunched before deleting the record. You can also apply any filter condition as well to handle valid business use case.Next , you can add simple Send Email action to send notification mail to required user.
You can handle other use cases as well without writing apex for handling the delete trigger.