web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Handling D365 F&O Legal Entities in CRM without Dual-write (Custom API Integration)

(1) ShareShare
ReportReport
Posted on by 75

We are building a custom integration between D365 F&O and Dynamics 365 Sales (CRM) using Custom APIs. We decided not to use Dual-write to keep the integration logic simpler and more controlled.

In our F&O environment, we have two Legal Entities. I need to mirror this structure in CRM correctly to ensure:

  1. Data Isolation: Users belonging to Legal Entity A should not see records belonging to Legal Entity B.

  2. API Mapping: When a record is updated in CRM, the API needs to know which dataAreaId to target in F&O.

My question is: What is the most "Standard" and recommended way to handle this in CRM without breaking the native system logic?

  • Should I create a Business Unit (BU) for each Legal Entity to handle security and visibility?

  • Should I use a Custom Text Field to store the Company Code for API mapping?

  • Or is a Hybrid approach (BUs for security + Custom Field for API string mapping) the best way to go?

I want to follow the best practices for CRM architecture so that the system remains scalable and easy to maintain.

Has anyone implemented this scenario using APIs? Would love to hear your advice!

Categories:
I have the same question (0)
  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,618 Super User 2026 Season 1 on at
     
    A few questions:
    1. Have you considered mapping the FO legal entity with cdm_company entity in Dataverse?
    2. Custom text field in FO or CE, on which platform are we considering it here for API Mapping?
    3. Is Legal entity A and B linked or is B a child entity of A or vice-versa?
     
    Suggestions:
     
    One parent business unit From CE mapped to each FO legal entity through cdm_company entity in Dataverse will suffice. Considering the requirement mentioned in the question, no need to go for a hybrid approach or a custom text field. 
     
    Steps:
    1. Create a legal entity in D365 FO and map it with the cdm_company entity in Dataverse.
    2. In dual write setup, add the new company to the company filters for relevant mapping. Dual-write follows company contexts so only the new data company will sync.
    3. Run intial sync on affected maps. This doesn't need pausing of interfaces etc, only pausing and resuming specific maps if needed for dependencies (if any). Dual write pause and sync in D365 FO should help. 
    4. Monitor the initial sync details tab for errors, if any. 
    5. There is a Dual write async process which is in preview mode that decouples synchronization from live transactions, potentially allowing inital sync on the background without blocking. Its in FO but not Generally available yet. You can try this approach in the test environment or on a test instance for the time being.
     
    Hope this helps. Happy to answer questions, if any.
  • Mohammed Rafe Profile Picture
    75 on at
    Hi @Navneeth Nagrajan
    thank you so much for your detailed response and for highlighting these points!

    To clarify my situation regarding your questions:

    1. Regarding cdm_company: Since we have completely moved away from Dual-write, I was under the impression that mapping to cdm_company might add unnecessary complexity to our custom API logic.

    2. Platform for Custom Field: I am considering the mapping logic primarily from the F&O side, as I am the F&O lead, but the field itself will likely be created in Dynamics 365 CE to hold the company context for our API calls.

    3. Legal Entity Structure: The entities are entirely separate; there is no parent-child relationship between them.

    Important Note on Dual-write:
    The steps you mentioned (Initial sync, company filters, and the Async preview) are very helpful for a Dual-write setup. However, as I mentioned, we have strictly shifted to a Custom API-based integration to avoid the specific issues we faced with Dual-write.

    This is why I am looking for the most "Standard" way to handle the Legal Entity context inside CRM specifically for an API-driven architecture.

    I really appreciate your time and expertise! What would be your advice for this scenario, specifically for an API-only approach?


     
  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,618 Super User 2026 Season 1 on at
     

    You can use either of the approaches, for the API integration. Done both the scenarios for a few customers. 

    1. For API integration, you can populate the Legal entity(LE) in F&O with the parent business unit in CE. Both the data types are string so the transformation should be relatively easier. In this case, you have 2 legal entities in F&O which is equivalent to two parent business units in CE. Also, in F&O when you fetching the CE business unit name description ensure the description in F&O is retrieved using System.String for ease of transformation.

    2. Because you are preferring sticking to the CRM Architecture, would recommend going with the cdm_company approach although Dual write is out of scope because this aligns with the Microsoft extensibility standards and avoids bottlenecks in reporting although you are considering custom API integration. This approach ensures consistency with the Dataverse standards. If you want standardized and upgrade safe approach then embrace cdm_company approach and hook the API logic into it.

    With regards to the legal entity structure because the entities are seperate the parent business units in CE should map directly with the independent LEs in F&O.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 109

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 76 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Martin Dráb 58 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans