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
- In Salesforce, click the gear icon and select Setup.
- Go to Platform Tools > Process Automation > Flows.
- Click New Flow.
- Select Record-Triggered Flow and then click Next.
- Select Auto-Layout. Flow Builder automatically organizes the connectors for you.
- Click Edit.
- Select the following:
Trigger the Flow When: A record is deleted. - Click Choose Object and then search for and select Opportunity Product. Add the following values to the fields in the Choose Object dialog:
Field Value Condition Requirements All Conditions Are Met (AND) AppDirect__AppDirect_ID__c Operator: Is Null Value: False - Click Done.
To add an element to the Record-Triggered flow
- Click the + under the Start condition.
- Select Action as the interaction.
- Filter by Type and then select Apex Action.
- 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.
- Enter the following values to the fields in the New Action dialog:
Field Value Label Remove Opportunity Item API Name Remove_Opportunity_Item Description Removes an opportunity Item from an AppDirect opportunity Opportunity Item UUID {!$Record.AppDirect__AppDirect_ID__c} Opprtunity UUID {!$Record.Opportunity.AppDirect__AppDirect_ID__c} - Click Done.
To save the flow
- Click Save
- Add the following values to the fields in the Save the Flow dialog:
Field Value Flow Label Remove Opportunity Item in AppDirect Flow API Name Remove_Opportunity_Item_in_AppDirect Description Remove an opportunity Item from an AppDirect Opportunity when it is deleted in Salesforce - Click Save.
- Click Activate. The flow is activated and is displayed in the All Flows table.
Was this page helpful?
Tell us more…
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!