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?
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.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156