Loading...

How To Design Data Entity For Dual-write in Dynamics 365 Finance & Operations

How To Design Data Entity For Dual-write in Dynamics 365 Finance & Operations

Testing The Waters Is Better Than Drowning in the Pool! isn't it so? 🏊

Long story short, there are two sets of Data entities in Dynamics 365 FO.

  1. Standard data entities
  2. Dual-write specific data entities (Postfix as CDSEntity)

The core purpose of having these categorizations is to manage, simplify & better control ALM, CE & ERP-related business scenarios, External party integration, or some processes that required some additional logic to be called to handshake with other downstream processes.

image.png

How Does It Work Under The Hood?

This is more about how data entities are designed in Dynamics 365 FO.

Dynamics 365 FO data entities are more complex since they encompass a wide range of data sources.

image.png Furthermore, each data source could result in multiple tables. During a transaction, most processes should be performed within the context of the table, not within individual data entities.

A dual-write identifies whether a certain table is affected by a change on a certain form, for example, the customer form. When changing the customer form, changes are made to the customer table, addresses, and retail account tables.

As a matter of fact, it does not use the data entity, but rather it changes the table. Due to dual-write, this process recognizes that these two or three tables that have changed during the process relate to the CustCustomerV3Entity entity, and that they have all been modified to correspond to records in the CustTable entity.

In order to do this, it tries to find out table relations and determine what all final entities' records have been affected. In other words, the more maps or cross-data sources you have, such as DirPartyBaseEntity etc. In other words, databases are hitting the same type of record multiple times for different types of data.

Therefore, editing one global address book record could result in editing more than one entity, causing more than one entity on the Dataverse to be affected.

Thus, it is always recommended to create data entities as thin as possible from a Dual-write perspective.

It is worthwhile to use newly released light weight Data entities in the context of above scenario i.e., CustCustomerBaseEntity (Customer definitions), CustCustomerDetailV2Entity (Customer details V2)

What To Consider While Designing Dual-write Data Entities?

  1. Create a custom data entity with only the required data sources (tables) and enabled the required fields
  2. Remodel the Data entity in Dynamics 365 FO to remove unused data sources and tables or implement getEntityRecordIdsImpactedByTableChange to optimize the runtime queries
  3. Avoid using the same table which is being tracked by multiple data entities because any change to the table will trigger a Dual-write evaluation for the linked Data Entities
  4. In the event that point no. 3 is unavoidable due to business processes, you should consider simplifying the entity or evaluating query optimizations for data entities
  5. Read-only and outer join data sources should be removed since they cannot be tracked
  6. Data sources without any fields mapped should be removed, as these will not be tracked
  7. Data sources (tables) that are mapped must be registered with business events

Additional tips: 💪

Dynamics 365 FO will trigger the changes only if the fields mapped to the records were modified. However, Dynamics 365 CE and Power Apps trigger all field modifications in Dual-write.

I hope this article was a good read for you. Do share it with your friends and other peers.

Thank you for Reading - Let's Connect!

Enjoy my blog? For more such awesome blog articles - follow, subscribe and let's connect on LinkedIn, Twitter, YouTube

Stay tuned!

Published on:

Learn more
Rakesh Darge's Blog
Rakesh Darge's Blog

Rakesh Darge's Blog

Share post:

Related posts

"Fix ‘This is Not a Unified Environment’ Error in D365 FO – Why Metadata Download Fails in Visual Studio"

🚨 “This is not a unified environment…” - A Story Every Dynamics 365 Finance & Operations Developer Should Hear Let me start with a real story...

4 months ago

PPAC Unlocked: Deploying Dynamics 365 ERP Environments with and without Demo Data

Let me start with a story… A few months ago, I was working with a customer who was planning to implement Dynamics 365 ERP. Their approach was ...

4 months ago

My Experience with AB-100: Earning the Microsoft Certified AI Business Solutions Architect Badge

The AI space is evolving rapidly, but very few certifications truly reflect how AI is designed, governed, and delivered in real business envir...

6 months ago

Demystifying the Copilot Sidecar Architecture in Dynamics 365 Finance and Operations ERP: A Solution Architect’s Guide

Welcome to the future of enterprise resource planning! If you're exploring the world of Dynamics 365 Finance and Operations (F&O), you've like...

1 year ago

Accelerate Your Development with Dynamics 365 FO Custom Batch Framework Templates

No matter the complexity of Dynamics 365 FO implementation, developing custom batch jobs is always necessary to accommodate tailored business ...

1 year ago

Improve Dynamics 365 FO Non-continuous Number sequence Performance: Tips and Strategies for Success!

Navigating performance issues in Dynamics 365 FO can be quite a challenge. There are numerous factors and considerations to take into account ...

1 year ago

How do we analyze Dynamics 365 FO Golden Copy configurations across the environments?

In the ever-evolving Dynamics 365 FO ecosystem, maintaining Golden Copy configurations remains one of the most discussed and reimagined aspect...

1 year ago

My Top 10 Learning of Copilot for Dynamics 365 Finance & Supply Chain Management

Hey Learners, 👏It seems that Microsoft Copilot, the AI-powered assistant, is gaining popularity worldwide. Customers and partners are trying ...

2 years ago

6 Prompts for resolving Tier 1 ERP table mapping challenges with Dynamics 365 Finance & Supply chain

Wouldn't it be great if we could simplify a few complex tasks to boost Dynamics 365 FO implementation productivity?There have been a number of...

2 years ago

Architecting For File Security : Solution Design Approaches to Encrypting and Decrypting File Data in Dynamics 365 Finance - Part I

The security of data is one of the most pressing concerns in the digital age. Whether you're sharing sensitive information over the internet, ...

2 years ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.