Configuring a Salesforce Flow to Delete Revenue Schedules When a Source Record Is Deleted
If Revenue Management is configured to generate revenue schedules, you can set up a Salesforce flow so that when a source record is deleted, its unrecognized revenue schedule lines are also deleted so that obsolete data does not accumulate. If the source record being deleted has "Complete" revenue schedule lines, those lines are not deleted and the revenue 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 revenue schedules. See Setting up Revenue Management and Additional Setup for Generating Revenue Schedules.
For information about how to configure Revenue Management to recognize revenue against revenue schedules, see Enable Recognize Revenue 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 Revenue Schedules
Label: Delete Obsolete Timecard Schedules
API Name: Delete_Obsolete_Timecard_Schedules
Description: Delete obsolete revenue 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 revenue schedule lines for that timecard are also deleted. This means that obsolete revenue schedules do not accumulate.