✏️ Explanatory Question

What is dual-write in Dynamics 365 Finance & Operations? How does it differ from virtual entities, what are table maps and initial sync, and how is error handling managed when a sync fails?

👁 8 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation

D365 F&O • X++ INTERVIEW

Dual-write & Dataverse Integration in Dynamics 365 Finance & Operations

Question 57 — Near-real-time, bi-directional sync between F&O and Dataverse.

Interview Question

What is dual-write in Dynamics 365 Finance & Operations? How does it differ from virtual entities, what are table maps and initial sync, and how is error handling managed when a sync fails?

Model Answer (Short)

Dual-write provides near-real-time, bi-directional, synchronous integration between F&O and Dataverse, so shared master data (customers, products, etc.) stays consistent across finance/operations and the Customer Engagement / Power Platform apps. It works through table maps that link an F&O entity to a Dataverse table with field mappings; when a record is created/updated on one side, the change is written live to the other. Before running live you perform an initial sync to align existing data. This differs from virtual entities, which surface Dataverse data in F&O (or vice versa) without physically storing/copying it — virtual entities are read-through, dual-write is a true data copy kept in sync. Because dual-write is synchronous, a failure can block the transaction, so you configure error handling (pause, retry, and monitoring in the dual-write admin) carefully.

Detailed Explanation

Table maps & mappings

  • A table map links an F&O data entity to a Dataverse table.
  • Field-level mappings define how columns correspond (incl. value transforms).
  • Maps can be enabled/disabled individually and run in a defined order for dependencies.
  • Standard maps ship out of the box; custom maps can be authored for custom entities.

Initial sync & live sync

  • Initial sync aligns existing records before turning on live write.
  • After that, changes flow bi-directionally in near real time.
  • Writes are synchronous — both sides commit together.

Error handling

  • A failed sync can block the originating transaction (because it's synchronous).
  • Configure pause / resume and retry behaviour in the dual-write admin.
  • Monitor errors and reprocess failed rows from the admin workspace.
  • Design mappings to avoid required-field mismatches that cause failures.
KEY DISTINCTION
Dual-write = synced copy (bi-directional)  •  Virtual entity = read-through, no copy

Prerequisites (Rule 5)

  • An F&O environment linked to a Dataverse / Power Platform environment.
  • Appropriate admin roles to configure dual-write.
  • Public, syncable data entities on the F&O side.
  • Matching or mappable Dataverse tables/columns.

Example — Enabling a table map (conceptual steps)

# In the Data management > Dual-write workspace:
1. Link the F&O environment to the Dataverse environment
2. Select the table map (e.g. Customers V3 <-> account)
3. Run Initial sync to align existing records
4. Enable "Run" so live bi-directional sync begins
5. Monitor the map for errors and reprocess if needed

Custom logic on a syncable entity (still runs for dual-write)

// Validation on the entity applies whether the write comes from
// the UI, OData, DMF, or a dual-write sync.
public boolean validateWrite()
{
    boolean ret = super();

    if (this.CreditLimit < 0)
    {
        ret = checkFailed("Credit limit cannot be negative.");
    }
    return ret;
}

Virtual entity (read-through) — contrast with dual-write

# A virtual entity surfaces Dataverse data in F&O (or vice versa)
# WITHOUT copying it. No initial sync, no stored duplicate — data
# is read live from the source system when queried.

Dual-write vs. Virtual Entities vs. DMF

Aspect Dual-write Virtual entities DMF
Data stored on both sides Yes (synced copy) No (read-through) Yes (file-based copy)
Direction Bi-directional Read (mostly) Import & export
Timing Near real-time, synchronous On query Batch / scheduled
Best for Shared master data Occasional cross-system reads Bulk migration/integration

Points the interviewer wants to hear

  • Dual-write = near-real-time, bi-directional, synchronous sync with Dataverse.
  • Table maps link an F&O entity to a Dataverse table with field mappings.
  • Initial sync aligns existing data before live sync starts.
  • Because it's synchronous, a failure can block the transaction — configure error handling.
  • Virtual entities are read-through (no copy); dual-write keeps a synced copy.

Likely Follow-up Questions

  • What is the difference between dual-write and virtual entities?
  • Why is initial sync needed before enabling live sync?
  • What happens to the F&O transaction if a dual-write sync fails?
  • When would you choose dual-write over DMF?

Key Takeaway

Dual-write keeps F&O and Dataverse in near-real-time, bi-directional sync via table maps and an initial sync. It stores a synced copy on both sides (unlike read-through virtual entities) and, being synchronous, demands careful error handling so failures don't block transactions.