Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

Composite entity key

(0) ShareShare
ReportReport
Posted on by 308

Hi,

If we want to make a composite entity. Should the entity key of the main entity be repeated in all child entities?

I mean if let's say in the composite entity, the main entity was EntityA where the Entity key is fieldA and below this enity we have 2 other entities on the same level (Entity B and Entity C)

Should the entity key for EntityB and EntityC contain field A as a must with another unique field?

Another question,  can I create a composite entity with the entity repeated? I mean it consists of EntityA and EntityA?

I know it doesn't make sense but can we?

In this case, can the entity key for each one be fieldA only? Or should the main datasource have Entity key as fieldA and the other entity should have fieldA with RecId for example? 

  • Martin Dráb Profile Picture
    Martin Dráb 230,836 Most Valuable Professional on at
    RE: Composite entity key

    That child enitities in a composite entity are related to the parent entity through its entity key is a typical scenario. But it doesn't have to be true in all cases. A child entity could be related to a non-key field of the parent entity.

    I guess you could use the same entity twice in the same composite entity. You can simply try it to know it for sure.

    I don't understand the last question. The entity key should contains fields needed to uniquelly identify a record in the entity. It has nothing to do with whether it's used in a composite entity and how. Exposing RecIds would be wrong. It's meaningless to uses and other systems; youy should use a natural key instead.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans