fbpx

Managing Sync Dependencies

Available in version 1.82 and up.

Purpose

The primary purpose of managing sync dependencies is to orchestrate and streamline the data synchronization process between Salesforce and QuickBooks. This management is crucial for maintaining data integrity, ensuring sequential accuracy, and facilitating conditional data transfers based on specific business logic.

In this context, managing sync dependencies involves defining and controlling the order in which records are synchronized between the two platforms. It ensures that prerequisite records in Salesforce are correctly synced to QuickBooks before their dependent records. This sequencing is vital in cases where the integrity of the dependent record’s data relies on the successful sync of its prerequisite record.

Use Cases

  • Sequential Data Syncing: Ensuring that dependent records in Salesforce are synced to QuickBooks before their prerequisite records.
  • Conditional Syncing: Triggering sync processes based on specific conditions in Salesforce records.

Sync Dependency

This object represents a dependency between two records.

Fields

  • Dependent Record Id: Stores the Salesforce or external ID of the record that depends on the prerequisite records.
  • Prerequisite Record Id: Stores the Salesforce or external ID of the record that has to be synced first.
  • Direction: Specify the direction of sync (Salesforce to QuickBooks or vice versa). This is the direction that the dependent record will sync.
  • QB Company Id: Stores the QuickBooks Company ID related to the record. This can be left blank if you only use 1 QuickBooks Company with Accord.
  • Type: Indicate the type of the parent record (e.g., Invoice, Payment).

Flow Action

The invocable flow action, named Create Sync Dependency (SF ➔ QB), is used for creating sync dependencies for records that need to be synchronized from Salesforce to QuickBooks. This action ensures that data flows in the correct order, maintaining data integrity and consistency. It creates Sync Dependency records for each prerequisite record that needs to be synced before the dependent record finally syncs. As the records sync successfully, anytime a prerequisite record syncs, its sync dependencies will be deleted and once the final sync dependency for a dependent record is deleted, then the dependent record is synced.

Parameters

The Create Sync Dependency (SF ➔ QB) invocable flow action includes several fields and parameters that control its functionality:

  1. Dependent Record Id (String, required): The Salesforce record ID of the dependent record that gets synced once all prerequisite records are synced.
  2. Prerequisite Record Id (String, required): The Salesforce record ID of the prerequisite record that needs to be synced prior to the dependent record.
  3. QB Company Id (String): The Id of the QuickBooks company. Note – Only Required if Accord is connected to more than 1 QuickBooks company.
  4. Sync Prerequisite Record (Checkbox): Indicates if the prerequisite record should be synced right away while creating the sync dependency. Otherwise, you can sync the prerequisite in some other part of the process depending on your business logic.

Implementation Steps

  1. Configure Action: Set up the Create Sync Dependency (SF ➔ QB) in your Salesforce flow, specifying the necessary fields based on your sync requirements.
  2. Define Trigger: Determine when this action should be invoked. Common triggers include record creation, record update, or a specific field change in Salesforce.
  3. Test: Rigorously test the action in a sandbox environment to ensure it behaves as expected under various scenarios.
  4. Deploy: Once tested, deploy the action in your production environment.
  5. Monitor and Maintain: Regularly monitor the sync process for any issues and make adjustments to the action parameters as needed.

Examples

Customer and Invoice

A common use case is to not sync Customers until the Invoice is finalized or approved. Now, you can create a sync dependency for the Customer that an Invoice is dependent on, and once the Customer is synced, then the Invoice will be synced.

  1. Create a record-triggered flow on the Invoice object.
  2. Define any conditional criteria for triggering this flow depending on your business logic.
  3. Create a decision element that checks if the related Customer’s, usually Account lookup, Accord QB Id is populated.
  4. In the “Yes” outcome, add the action called “Send to QuickBooks” to sync just the Invoice.
    • Record Id: Reference the Id of the record that triggered the flow, i.e., Invoice.
    • Company Id: Leave it blank, unless you have more than 1 QuickBooks company connected to Accord.
  5. In the “No” outcome, add the action called “Create Sync Dependency (SF ➔ QB)” to create a sync dependency for the Customer.
    • Dependent Record Id: Specify the Id of the Invoice.
    • Prerequisite Record Id: Specify the Id of the related Account (Customer).
    • QuickBooks Company Id: Leave it blank, unless you have more than 1 QuickBooks company connected to Accord.
    • Sync Prerequisite Record: Set it to true, this will sync the Customer without us needing to add another “Send to QuickBooks” action.
  6. Save and Activate the flow.

Invoice and Payment

Another common use case is to sync Invoices that a Payment gets applied on to QuickBooks first, and finally the Payment. QuickBooks requires that all linked transactions exist prior to creating the Payment, so this ensures that all Invoices are in the system and the Payment gets synced only once when all the Invoices finish.

  1. Create a record triggered flow on the Invoice Payment object or whatever you called the junction object between Invoice and Payment.
  2. Define any conditional criteria for triggering this flow depending on your business logic. In this case, we are going to trigger it anytime the junction object is created/updated.
  3. Add the action called “Create Sync Dependency (SF ➔ QB)” to create a sync dependency for the Invoices.
    • Dependent Record Id: Specify the Id of the Payment.
    • Prerequisite Record Id: Specify the Id of the related Invoice.
    • QuickBooks Company Id: Leave it blank, unless you have more than 1 QuickBooks company connected to Accord.
    • Sync Prerequisite Record: Set it to true, this will sync the Invoice without us needing to add another “Send to QuickBooks” action.
Go to Top