Skip to main content

Create a delete opportunity line item flow

The delete opportunity line item flow removes a line item in the AppDirect opportunity when the line item in the opportunity is deleted in Salesforce.

To create a delete opportunity line item flow

  1. In Salesforce, click the gear icon and select Setup.
  2. Go to Platform Tools > Process Automation > Flows.
  3. Click New Flow.
  4. Select Record-Triggered Flow and then click Next.
  5. Select Auto-Layout. Flow Builder automatically organizes the connectors for you.
  6. Click Edit.
  7. Select the following:
    Trigger the Flow When: A record is deleted.
  8. Click Choose Object and then search for and select Opportunity Product. Add the following values to the fields in the Choose Object dialog:
    FieldValue
    Condition RequirementsAll Conditions Are Met (AND)
    AppDirect__AppDirect_ID__cOperator: Is Null Value: False
  9. Click Done.

To add an element to the Record-Triggered flow

  1. Click the + under the Start condition.
  2. Select Action as the interaction.
  3. Filter by Type and then select Apex Action.
  4. Search and select Removes Opportunity Items in AppDirect.

    Note: Ensure that you select the correct Apex action. If the wrong Apex action is selected, data does not move to AppDirect and errors will be logged . For example, Selecting Transmits Opportunity to AppDirect instead of Transmits Opportunity Item to AppDirect.

  5. Enter the following values to the fields in the New Action dialog:
    FieldValue
    LabelRemove Opportunity Item
    API NameRemove_Opportunity_Item
    DescriptionRemoves an opportunity Item from an AppDirect opportunity
    Opportunity Item UUID{!$Record.AppDirect__AppDirect_ID__c}
    Opprtunity UUID{!$Record.Opportunity.AppDirect__AppDirect_ID__c}
  6. Click Done.

To save the flow

  1. Click Save
  2. Add the following values to the fields in the Save the Flow dialog:
    FieldValue
    Flow LabelRemove Opportunity Item in AppDirect
    Flow API NameRemove_Opportunity_Item_in_AppDirect
    DescriptionRemove an opportunity Item from an AppDirect Opportunity when it is deleted in Salesforce
  3. Click Save.
  4. Click Activate. The flow is activated and is displayed in the All Flows table.

Was this page helpful?