Site icon Salesforce News Technology Stuff

Before Delete Flow in Winter 21

Before Delete Flow in Winter 21 are great addition. But this is the not only enhancement which we got in Winter 21. If you still have not checked the Salesforce Winter 21 release notes, you can check here. This release includes many feature related to Flow including Before Delete Flow, New Multi-Screen components, Auto layout in Flow, Filter criteria before execution so that we can avoid unnecessary execution, Use AND, OR, and Custom Operators Across All Flow Builder Elements and ability to test flow with another user.
So today while we will focus on Before Delete Flow, we will also check other points as well.

New Flow Screen

Firstly when we start creation a we see a new option here. So we can notice that now we have option to for delete as well. Previously we are dependent on Trigger for this. But now we can achieve this using Flow as well.
Note: Undelete event is still not supported. So we need to use trigger if we want to perform some action on that.

Layout Selection

On the next screen we got two options: The classic Freeform and the new Autolayout. In Autolayout Canvas organization and Component connections are Automatic

Configure Trigger with Before Delete Flow

In our demo we are using Autolayout. Now comes the main part. We have a new option here: A record is deleted. We can add Create, Update, Delete records element with this option to add functionality. We can also use custom action with before delete flow. Previously in case of delete event the only option was trigger.
Note: If we want to prevent user from record deletion trigger is still a better approach. or you can use some hack to throw exception (not recommended).

Object Selection With Filter Criteria

We have selected delete event. In our demo we want to send an email to Owner whenever a contact record was deleted. So in next screen we will select object and configure it.
Here we also notice that now we have option to add Filter criteria to run it for only selected records. Previously it will always run but now we can add filters. And it may improve our system execution performance.

Once we completed object selection we will add one action to send email. We can also call Apex here. So this is how our final UI will look like:

Debug Flow as another user

Now when we run this Flow and if some user got any error then how we will debug. In Winter 21 release we now have option to debug Flow as any user. If its not enabled for org you can enable it under Process automation setting.
So now we can debug our flow with any user and can check permission and other user specific issue.

The multi column layout is still in pilot. So once it is available we will discuss that as well. I will try to cover few scenario which we can achieve using flow as well.

Like My Facebook and Instagram page for more update

Which feature you would like to add in Flow now, Let me know in comments. Happy Programming 🙂

Exit mobile version