Skip to content

Sync Configuration

Control how and when data flows between Microsoft Dynamics 365 Business Central and the EUDR platform.

Trigger a sync on-demand from the UI or via API:

POST /api/integrations/:id/dynamics/sync
Content-Type: application/json
{
"modifiedSince": "2024-01-15T00:00:00Z"
}

Omit modifiedSince for a full sync of all records.

Integrate sync into your CI/CD or scheduled tasks:

Terminal window
curl -X POST https://backend.joinnentropy.com/api/integrations/{id}/dynamics/sync \
-H "Cookie: session=..." \
-H "Content-Type: application/json" \
-d '{"modifiedSince": "2024-06-01T00:00:00Z"}'

Response:

{
"success": true,
"data": {
"suppliers": { "created": 5, "updated": 12, "errors": 0 },
"products": { "created": 3, "updated": 8, "errors": 1 }
}
}

Each sync operation processes two entity types:

BC EntityPlatform EntityDirection
VendorsSuppliersBC → Platform
ItemsProductsBC → Platform

Fetches all records from Business Central. Use this for:

  • Initial data import
  • Periodic full reconciliation
  • After fixing mapping issues

Use the modifiedSince parameter to only fetch records changed after a specific timestamp. This is significantly faster for large datasets.

The platform stores lastSyncedAt on each integration to help track the last successful sync time.

When a record exists in both systems, the sync engine applies these rules:

ScenarioBehavior
New record in BCCreated in platform
Updated record in BCUpdated in platform (BC wins)
Deleted record in BCNot deleted in platform
New record in platformNot synced to BC
Updated record in platformNot synced to BC

Records are matched using a composite key:

  • externalId — The Business Central record ID
  • externalSystem — Always dynamics_bc
  • userId — The platform user who owns the integration

This means the same BC record can be synced by different platform users without conflicts.

Each synced record has a syncStatus field:

StatusDescription
pendingRecord queued for sync
syncedSuccessfully synced
errorSync failed (check sync logs)
conflictManual resolution needed

Every sync operation creates detailed logs accessible via:

  • UI: Integrations → Sync History tab
  • API: GET /api/integrations/:id/sync-logs

Each log entry contains:

{
"id": "log-123",
"integrationId": "int-456",
"entityType": "SUPPLIER",
"action": "UPSERT",
"status": "SUCCESS",
"recordsAffected": 17,
"metadata": {
"created": 5,
"updated": 12,
"errors": []
},
"createdAt": "2024-06-15T10:30:00Z"
}

If some records fail during sync, the operation continues with remaining records. Failed records are logged individually in the sync metadata:

{
"errors": [
{
"externalId": "vendor-789",
"error": "Missing required field: name",
"data": { "displayName": null }
}
]
}

OAuth tokens expire after ~1 hour. The platform automatically refreshes tokens using the stored refresh token. If the refresh token also expires (typically after 90 days), you’ll need to re-authorize the connection.

Business Central API has rate limits. The sync engine handles 429 Too Many Requests responses by pausing and retrying. For large datasets, consider syncing during off-peak hours.

Before running a production sync, use the test connection feature:

POST /api/integrations/:id/dynamics/test

This verifies:

  1. OAuth credentials are valid
  2. Business Central API is reachable
  3. The integration can list companies
  4. Read permissions are working

Response:

{
"success": true,
"data": {
"connected": true,
"company": "CRONUS International Ltd.",
"vendorCount": 45,
"itemCount": 230
}
}
  1. Start with sandbox: Test your integration against a BC sandbox environment first
  2. Use delta sync: For regular syncs, always use modifiedSince to minimize API calls
  3. Monitor sync logs: Review the Sync History tab regularly for errors
  4. Set up webhooks: Configure webhooks to get notified of sync completions and failures
  5. Map custom fields: If your BC instance has EUDR-relevant custom fields, configure them in Sync Config