Configuring a Salesforce Flow to Delete Revenue Schedules When a Source Record Is Deleted

Warning:

These instructions are intended for users who are experienced at creating Salesforce flows. Refer to the Salesforce Help if you require more information.

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.)

Diagram of Process Flow to Delete Obsolete Schedules

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.

Notes:

The images in these instructions are shown as thumbnails. To expand an image, click it. To close an expanded image, click it again.

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.

  1. From Setup, navigate to Flows. Create a new flow of type Record-Triggered Flow.
  2. On the Configure Start window, set:

    Object: Timecard
    Trigger the Flow When: A record is deleted
    Set Entry Conditions: None

    Screenshot of Configuring the Start of a Delete Obsolete Schedules Flow

  3. Click Done.
  4. Click the + symbol between the Start Icon and the End icon, then choose to add an Action element.
  5. 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}

    Screenshot of Adding the Delete Action to the Flow

  6. Click Done.
  7. 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.