No Plugin, No Flow: Auto-Propagating Legal Entity Across 18 D365 Tables Using Formula Fields - CloudFronts

No Plugin, No Flow: Auto-Propagating Legal Entity Across 18 D365 Tables Using Formula Fields

No Plugin, No Flow: Auto-Propagating Legal Entity Across 18 D365 Tables Using Formula Fields

Summary

  1. As part of our internal PO (Project Operations) to F&O integration product, every transaction needs to know which legal entity it belongs to — yet no out-of-box mechanism exists to propagate this across the 18+ connected tables involved.
  2. We built a zero-code, zero-maintenance solution using Dataverse formula fields: set Legal Entity once on Account, and every related record inherits it automatically.
  3. A custom Legal Entity table maps company master records to FO DataAreaId codes, and formula fields chain the value down through the entire relationship hierarchy.
  4. Three entities with polymorphic lookups blocked formula traversal — solved with a direct lookup field auto-populated via a Business Rule, requiring no user action.
  5. Business impact: eliminated manual per-record entry, removed CRM–FO mismatch risk, and replaced plugin/flow maintenance overhead with pure declarative formula fields.

The Challenge

In our internal PO (Project Operations) to F&O integration product, every transaction needs to know which legal entity it belongs to — yet no out-of-box mechanism exists to auto-propagate this across the 18+ connected tables involved.

The traditional approach? Manual entry, plugins, or complex flows — all high maintenance, all error-prone.

What We Built

A zero-code, zero-maintenance auto-propagation solution using Dataverse formula fields — no plugin, no Power Automate flow for downstream entities.

The core idea: set Legal Entity once on Account. Every related record inherits it automatically.

How It Works

  • One custom table — Legal Entity — stores company master records mapped to FO DataAreaId codes (e.g. ac, USMF).
  • One manual input — user sets Legal Entity on Account. That’s it.
  • Everything else is automatic — formula fields chain through the relationship hierarchy.
Account (set once) → Contact, Project Contract, Invoice → Contract Lines, Projects → Tasks, Time Entries, Expenses, Actuals, Team Members, Role Prices…

The One Technical Wall

Three entities — Contact, Salesorders, Invoices, Projects — use polymorphic lookup fields that block formula traversal.

Solved by adding a clean direct lookup — cf_accountref — populated automatically via a Business Rule. No user action needed.

The Outcome

BeforeAfter
Legal Entity entered manually per recordSet once on Account — cascades to 18 tables
Risk of mismatch between CRM and FOSingle source of truth — always in sync
Plugin or flow required for automationPure formula fields — zero maintenance
Existing records needed manual updateOne-time bulk flow backfilled all records

The Bigger Point

Data Governance Principle

This isn’t just a technical pattern — it’s a data governance principle: in multi-entity implementations, master attributes should live at the top of the hierarchy and flow down automatically, not be re-entered at every level. Formula fields make this possible in Dataverse without a single line of code.

Frequently Asked Questions

Why not just use a plugin or Power Automate flow instead?
Plugins and flows both introduce ongoing maintenance overhead — deployment, error handling, throttling limits, and monitoring. Formula fields are declarative, run natively inside Dataverse, and require no execution infrastructure or upkeep.
What happens when a polymorphic lookup blocks the formula chain?
Dataverse formula fields can’t traverse polymorphic (multi-target) lookups directly. The fix is a dedicated single-target lookup field, populated automatically by a Business Rule, that formula fields can then reference downstream.
Does this approach scale beyond 18 tables?
Yes. As long as each new table has a traceable relationship path back to Account (directly or through an intermediate entity), a formula field can be added to inherit Legal Entity without any additional plugin or flow logic.
What about records that already existed before this was implemented?
A one-time bulk update was run to backfill Legal Entity on existing records. Going forward, all new and related records inherit the value automatically through the formula field chain.

Conclusion

Legal Entity tracking is a small field with outsized consequences — get it wrong, and financial reporting, cross-entity reconciliation, and downstream automation all inherit the error. The instinct in most implementations is to reach for a plugin or a flow to keep it in sync. This solution proves that’s not always necessary.

By anchoring Legal Entity at the top of the hierarchy on Account and letting Dataverse formula fields carry it down through 18 connected tables, we removed an entire category of maintenance — no custom code to patch, no flow runs to monitor, no throttling limits to worry about. The system simply stays correct by design.

It’s a reminder that the most resilient integrations are often the ones that need the least ongoing attention. When a platform-native feature can solve a problem cleanly, it usually outlasts a custom-built one.

About Me

DC
Author

Deepak Chauhan

Consultant and Databricks Certified Data Engineer with 4 years of experience across Dynamics 365, Data & AI, and BI.

Building Something Similar?

If you’re wrestling with multi-entity data consistency in Dataverse or D365, formula fields might solve more than you expect — before you reach for a plugin or a flow.

Get in Touch


Share Story :

SEARCH BLOGS :

FOLLOW CLOUDFRONTS BLOG :


Categories

Secured By miniOrange