Configuring a Salesforce Flow to Delete Recognition Schedules When a Source Record Is Deleted
If Revenue Management is configured to generate recognition schedules, you can set up a Salesforce flow so that when a source record is deleted, its unrecognized recognition schedule lines are also deleted so that obsolete data does not accumulate. If the source record being deleted has "Complete" recognition schedule lines, those lines are not deleted and the recognition schedule's status is set to "Source Unavailable".
Here is an outline of the flow you will be building. (Click the image to expand it.)
Before You Begin
Before you begin, Revenue Management must be configured to generate recognition schedules. For more information, see Getting Started with Recognition Schedules.
Creating the Flow
In these instructions, you must specify your source object. For illustration purposes, these instructions use PSA' s Timecard as the source object.
- From Setup, navigate to Flows. Create a new flow of type Record-Triggered Flow.
- On the Configure Start window, set:
Object: Timecard
Trigger the Flow When: A record is deleted
Set Entry Conditions: None - Click Done.
- Click the + symbol between the Start Icon and the End icon, then choose to add an Action element.
- Complete the New Action window as follows:
Action: Delete Recognition Schedules
Label: Delete Obsolete Timecard Schedules
API Name: Delete_Obsolete_Timecard_Schedules
Description: Delete obsolete recognition schedules when timecard is deleted
Set Input Values: {!$Record.Id} - Click Done.
- Save your flow then click Activate.
Now when you delete a timecard, any unrecognized recognition schedule lines for that timecard are also deleted. This means that obsolete recognition schedules do not accumulate.