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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Is it possible to use a composite data entity, for which the data sources of the underlying entity data sources have composite Entity key fields?

(0) ShareShare
ReportReport
Posted on by 46

Dear community,

I have a requirement to develop a composite data entity consisting of one parent and one child entity. Both parent and child entity have a EntityKeys consisting of multiple fields (parent 4, child 5 fields). I develop composite entity consisting of both entities, but when I try to run it, the warning "Composite entity doesn't have primary or unique key. Staging table needs to be altered". Run both entities individually does not give any issue. This gives me the impression that Composite data entities only could run if both parent and child entities have one EntityKey field for each. Is this conclusion correct, or do yours know an example in the standard application, with the use of a composite entity with a multifield Entity Key for both parent and child?  

pastedimage1667646918296v1.png

I have the same question (0)
  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    How does that the primary key of the staging table (for "Data entity for hour balance budger worker transactions") looks like? Do you have a relation between staging tables?

    You mentioned just entity keys, but the warning is about the staging table.

  • Suggested answer
    Sammy Meow Profile Picture
    46 on at

    Hi Martin, StagingIdx consists of the same fields as EntityKey fields + DefinitionGroup + ExcecutionId, so I don't think that this is the problem. I think that the problem is to define a unique relationship between the Parent Table/Entity which is a 3rd party product vs ChildTable/Entity which is my customization.

    Table keys(index) looks as follows:

    Parent: Fields A, B+"FromDate"

    Child: Fields A+B+"TransDate"+C+D  

    I have chosen to key the Entity and Staging Table to the Parent fields A+B, but I think that the "FromDate" should also be linked, which is in this particular case not possible as we cannot define conditional keys.

  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    If the entity key of the Parent consists of three keys and your relation uses just two of them, your relation is wrong, because it doesn't uniquely identify the parent.

    I have no idea what you mean by a conditional key and you're claiming that including FromDate field in a relation is impossible.

  • Sammy Meow Profile Picture
    46 on at

    What I mean is that I think that's not possible to create a relationship which is conditional. In this example: creating a relation between the Parent's "FromDate" and the Child "Transdate" field, which is only is a(n) (active) relation if the Childs "TransDate" is bigger than the Parent "FromDate". So far as I know, it's not possible to define such kind of relations. Correct me if I am wrong.

  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    What you're describing is indeed not a table (or entity) relation.

    If you stop speculating about things like that a relation may have just a single field, and you describe your business requirement instead, we might be able to suggest a solution that can actually be implemented.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans