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?
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.
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?
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.
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?
Yes, using entities as data source is an option, if it makes things easier. If it doesn't add any value, use tables directly.
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?
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.
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156