---
title: Setup Integration for Records Deleted in Salesforce (optional)
description: Accord Sync allows you to delete records from Salesforce to QuickBooks Online by leveraging Salesforce flows and triggers. For each object that you want to allow deleting the record in QuickBooks when a record is deleted in Salesforce, you will…
url: "https://accordsync.com/docs/setup-integration-for-records-deleted-in-salesforce/"
updated: "2023-10-18"
category: Configure and Setup Accord Sync
---

# Setup Integration for Records Deleted in Salesforce (optional)

Accord Sync allows you to delete records from Salesforce to QuickBooks Online by leveraging Salesforce flows and triggers. For each object that you want to allow deleting the record in QuickBooks when a record is deleted in Salesforce, you will have to check the **Allow Delete** checkbox for the QuickBooks object. Then, create a flow to create a platform event to trigger the sync that will delete the QuickBooks record when the Salesforce record is deleted.

**NOTE**
Real-time integration from QuickBooks to Salesforce is handled by Webhooks. If [Webhooks have been setup](https://accordsync.com/docs/setup-webhooks-with-quickbooks-online/) for your integration, enabled for each QuickBooks object, and **Allow Delete** has been enabled then real-time integration is already setup for records being deleted in QuickBooks.

**Configure Flow to Delete QuickBooks Record**

1. Navigate to **Setup**.
2. Go to **Home > Process Automation > Flows** in Setup.
3. Click **New Flow.**
4. Configure the Start of the flow:
   - Select the **Salesforce Object** that will have its records deleted from QuickBooks.
   - Trigger the flow when **A record is deleted**.
   - Enter any condition requirements you would like if you wanted to limit the records that get deleted from QuickBooks otherwise leave it as **None.**
     - If not all records are synced for the selected **Salesforce Object**, then you will need to add a condition that the **Accord QB Id** is not NULL to prevent errors.
   - Optimize the flow for **Before the record is deleted**.
   - Click **Done.**
     ![](https://accordsync.com/wp-content/uploads/2022/05/Accord-Setup-Integration-for-Records-Deleted-in-Salesforce-1-1024x480.png)
     ![](https://accordsync.com/wp-content/uploads/2022/05/Accord-Setup-Integration-for-Records-Deleted-in-Salesforce-2-1024x201.png)
5. Create a **Get Records**action
   Label: `Get Accord Record Status`
   API Name: `Get_Accord_Record_Status`
   Description: `Retrieves the related Accord Record Status.`

   Object: `Accord Record Status`

   Condition Requirements: `All Conditions Are Met (AND)`
   Field: `appclipse__SF_ID__c`
   Operator: `Equals`
   Value: `$Record > Record ID`

   How Many Records to Store: `Only the first record`
   How to Store Record Data: `Automatically store all fields`
   ![](https://accordsync.com/wp-content/uploads/2022/05/Accord-Setup-Integration-for-Records-Deleted-in-Salesforce-5.png)
   ![](https://accordsync.com/wp-content/uploads/2022/05/Accord-Setup-Integration-for-Records-Deleted-in-Salesforce-6.png)
6. Create a **Create Records**action.
   Label: `Publish Event`
   API Name: `Publish_Event`
   Description: `Publishes a QBO Sync platform event to delete a record in QuickBooks.`

   How Many Records to Create: `One`
   How to Set the Record Fields: `Use separate resources, and literal values`
   Object: `QBO Sync`

   **Set Field Values for the QBO Sync**
   Field: `appclipse__Id__c`
   Value: `$Record > Accord QB Id`

   Field: appclipse: `Operation__c`
   Value: `Delete`

   Field: `appclipse__Platform__c`
   Value: `Salesforce`

   Field: `appclipse__QB_Company_Id__c`
   Value: `$Record > Accord QB Company Id`

   Field: `appclipse__Type__c`
   Value: `Accord Record Status from Get_Accord_Record_Status > Type`
   ![](https://accordsync.com/wp-content/uploads/2022/05/Accord-Setup-Integration-for-Records-Deleted-in-Salesforce-3.png)
7. Save the flow.
8. Activate the flow.

![](https://accordsync.com/wp-content/uploads/2022/05/Accord-Setup-Integration-for-Records-Deleted-in-Salesforce-4.png)

Repeat these steps for each Salesforce object that you wish to set up an integration for deleted records.

**Next Step**
If you are using batch integration: [Schedule Batch Integration(s)](https://accordsync.com/docs/schedule-integration/)

If not, then your integration has been completed between QuickBooks Online and Salesforce. Continue to [monitor the sync and manage errors](https://accordsync.com/docs/sync-monitoring-error-management/) that appear.
