Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Convert composite entity to single entity

(0) ShareShare
ReportReport
Posted on by 308

Hi,

If we have a composite entity that we want to convert to single entity. (For import purposes)

- Is converting a composite entity to single entity and using it for import possible?

- Should the entity key for the single entity contain all entity key fields that are found in each entity in the composite entity? 

Or Should the entity key for the single entity contain all Unique fields that are found in each table in each entity of the composite entity? 

  • Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: Convert composite entity to single entity

    Whether it'll be OK or not depends on your requirements. Does it makes sense to create such a record? If fields are mandatory on the table and not on the entity, does it mean that the entity will generate their values (e.g. from number sequences)? Do you want to be able to insert multiple records with empty values to the straging table?

    I can't tell you that - it depends on what you want.

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: Convert composite entity to single entity

    Hi Martin,

    If u look at SalesOrderHeaderV2Entity for example

    The entity key is sales order number

    This field on entity level is set to Mandatory No

    Also this field on staging table is set to Mandatory No even though it's part of the primary Index of the table

    So based on that, I concluded that there is no need to make all fields mandatory, but still we can add them to entity key, even though there is a BP that says make them mandatory.

    So I just want to make sure that, if I convert the composite entity to a single entity, and put the entity key as the combination of the entity keys of all entities In the composite entity, then that would be ok. Even if not all fields are mandatory.?

    Cause as u know each entity in composite entity has entity key...but I can import using composite entity but without filling one of the entities even if it has a mandatory field right?

  • Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: Convert composite entity to single entity

    I can't comment on your data model, such as which fields must be mandatory.

    Usually all key fields are mandatory, except of enums, where 0 is a valid value.

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: Convert composite entity to single entity

    Hi Martin,

    Another question please:

    If I'm going to take all entity keys of the composite entity and put it in a single entity. In general, should the entity key fields be mandatory in the entity itself or the staging table?

    I don't want to be forced to fill all entity keys when uploading. Does that mean I need to remove them from the entity key or it's ok to have entity key that is not mandatory?

    Looking at standard staging tables of the entities inside the composite entity, I can see the primary index containing the fields of the entity key but they are not mandatory in the staging table..which means they are not following best practices. so I can do the same right?

  • Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: Convert composite entity to single entity

    Yes, using entities as data source is an option, if it makes things easier. If it doesn't add any value, use tables directly.

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: Convert composite entity to single entity

    Hi Martin,

    Do you mean that instead of using the tables inside each entity to create the new single entity, Then I can put the entities of the composite entity themselves in the new entity and join them? But if I still use tables then it's the same thing right?

    And the entity key should be the entity key of each one without duplication?

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,934 Most Valuable Professional on at
    RE: Convert composite entity to single entity

    There is no tool for merging the entities to one. You need to create a new entity by yourself. Note that you can potentially use the existing entities as data source of the new entity.

    How the entity key should look like depends on how the entity should behave. Using entity keys of the originally entities (without duplicates) will likely be a good approach in most cases.

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…

Vahid Ghafarpour – Community Spotlight

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

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans