---
title: "HubSpot to Business Central - Deals to Sales Orders Integration Guide"
description: "HubSpot to Business Central - Deals to Sales Orders Integration Guide"
keywords: "HubSpot to Business Central - Deals to Sales Orders Integration Guide"
url: "https://myrapidi.com/wiki/hubspot_to_business_central_deals_to_sales_orders_integration_guide"
locale: "en"
published: "2026-02-05T10:27:49Z"
modified: "2026-02-05T10:28:55Z"
---

## Overview

This guide documents the integration setup for syncing HubSpot Deals to Business Central Sales Orders using Rapidi. The integration supports two scenarios based on HubSpot edition capabilities.

## **Integration Architecture**

### **Scenario 1: Enterprise Edition (with Operations Hub)**

**Prerequisites:**

- HubSpot Enterprise or Professional edition with Operations Hub.
- Custom workflow capability in HubSpot ( provided by Rapidi).

### **HubSpot Custom Fields Required:**

| Field Name | Object | Type | Purpose |
| --- | --- | --- | --- |
| bc\_salesorder | Deal | Text | Stores BC Sales Order Number |
| erp\_customer\_no | Deal | Property Sync | Syncs BC Customer Number from Company |
| associated\_deal\_id | Line Item | Text | Populated by custom workflow |
| erp\_sales\_order\_no | Line Item | Property Sync | Stores BC Order Number on lines |

### **Custom Workflow Configuration**

Purpose: Automatically populate **associated\_deal\_id** on line items with the parent Deal ID.

Workflow Setup:

1. Trigger: Line Item creation or Deal association.
2. Action: Copy Deal's hs\_object\_id to Line Item's associated\_deal\_id.
3. Scope: All line items associated with deals.

### **Rapidi Setup Summary**

**Transfer Structure:**

- Main Transfer: DEAL00\_HUBSPOT\_BC\_SUBTR (Deals → Sales Orders)
- SubTransfer: DEAL00\_HUBSPOT\_BC\_SUBTR\_SUBTR001 (Line Items → Sales Order Lines)

Detailed Flow:

1. **Main Transfer Executes:**
  - Queries HubSpot for Deals where bc\_salesorder is empty (new/unsynced deals).
  - Pulls Deal data: deal name, close date, currency, customer number,etc.
  - Creates Sales Order in Business Central or other D365 ERP.
  - The ERP returns the new Sales Order Number (e.g., SO-10001)

2. **Rapidi Writes Back to HubSpot:**
  - Stores the BC Sales Order Number in the Deal's bc\_salesorder field.

3. **SubTransfer Auto-Executes (Same Transaction):**
  - Triggered automatically for the same deal that was just processed.
  - Uses LinkFilter: pulls Line Items where associated\_deal\_id = Deal's hs\_object\_id.
  - This field was pre-populated by the custom HubSpot workflow.
  - Pulls Line Item data: SKU, quantity, price.
  - Creates Sales Order Lines in BC linked to the parent Sales Order.

4. **Result** :
  - Complete Sales Order (header + lines) created in BC in one operation.
  - Deal marked as synced via bc\_salesorder field.

### **Scenario 2: Standard Edition (without Operations Hub)**

**Prerequisites:**

- HubSpot Professional/Starter edition (no Operations Hub).
- Cannot use custom workflows.

### HubSpot Custom Fields Required:

| Field Name | Object | Type | Purpose |
| --- | --- | --- | --- |
| bc\_salesorder | Deal | Text | Stores ERP Sales Order Number |
| erp\_customer\_no | Deal | Property Sync | Syncs ERP Customer Number from Company |
| erp\_sales\_order\_no | Line Item | Text | It automatically stores the ERP Order Number |
| transferred\_to\_erp | Line Item | Text | Transfer control flag |

### Rapidi Setup Summary

**Transfer Structure:**

- Transfer 1: DEAL01\_HUBSPOT\_BC (Deals → Sales Orders)
- Transfer 2: DEAL02\_HUBSPOT\_BC (Line Items → Sales Order Lines)

**Detailed Flow:**

**Phase 1: Header Creation**

1. Transfer DEAL01 Executes:
  - Queries HubSpot for Deals where bc\_salesorder is empty (new/unsynced deals).
  - Pulls Deal data: deal name, close date, currency, customer number.
  - Creates Sales Order header in the ERP.
  - BC returns the new Sales Order Number (e.g., SO-10001).

2. Rapidi Writes Back to HubSpot:
  - Stores the BC Sales Order Number in the Deal's bc\_salesorder field.

3. HubSpot Property Sync Activates:
  - Property sync field erp\_sales\_order\_no on Line Items monitors the parent Deal.
  - When Deal's bc\_salesorder field gets populated, it syncs down to all associated Line Items.
  - Each Line Item now has erp\_sales\_order\_no = "SO-10001".

**Phase 2: Line Creation**

1. Transfer DEAL02 Executes:
  - Queries HubSpot for Line Items where:
    - erp\_sales\_order\_no HAS\_PROPERTY (must be populated).
    - transferred\_to\_erp is empty (not yet synced).

2. Pulls Line Item data: SKU, quantity, price, and the erp\_sales\_order\_no.
3. Creates Sales Order Lines in BC.
4. Uses erp\_sales\_order\_no to match and link lines to the correct Sales Order header.
5. Rapidi Marks Lines as Transferred:
  - Updates Line Items in HubSpot with transferred\_to\_erp flag.
  - Prevents duplicate line creation on subsequent runs.

6. Result:
  - Sales Order header exists from Phase 1.
  - Sales Order lines now added and linked correctly.
  - Both Deal and Line Items marked as synced.
