Announcements
No record found.
Hi,
I have created a composite data entity using the following link: https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/develop-composite-data-entities
Importing composite entities is working fine, when I am trying to export it is showing an error "cannot create a record. The record already exists in the data entity."
I have two tables
Table1:
Fields: Rollnumber (Primary index)
Name
Table2:
Fields: Rollnumber (Primaryindex)
TotalMarks
Table1 and Table2 are related by the field Rollnumber using normal relation.
Could anyone help me with this.
Thanks,
Nithin
Most likely you have an issue with StagingIdx index for table2 staging table. Is the relation between Table1 and table2 done as one-to-many?
Are you sure it's about export? Export shouldn't write anything to entities; that's what import does.
Isn't it possible that the message is correct; that you already have records in database with the same Rollnumber?
Do your entities work correctly if you use them directly, not though a composite entity?
Hi Martin,
Sorry the error message is "Cannot create a record in Studentsubjectdetails_nitStaging (Table2)(Studentsubjectdetails_nitStaging). The record already exists."
The entities are working correctly if I use them directly.
Please refer to the below screenshot
Nithin.
is this export to BYOD?
check target data and data being exported for their primary key violation and suggest
Hi Nithin,
When you export data through composite entity data is exported to staging tables first.
First, you need to check if unique indexes on staging tables (Studentsubjectdetails_nitStaging) are made correctly.
I suspect that you have a StagingIdx index for table Studentsubjectdetails_nitStaging with only RollNumber field (in addition to DefinitionGroup and ExecutionId) and you need to add more fields to make it unique, for instance, subjectId or check the list of fields from the unique index for source table (Studentsubjectdetails_nit).
Hi Sergei,
I have adding Linenumber in stagingIdx for table StudentSubjectdetails_nitStaging, it is showing the same error.
Do you have other unique indexes on StudentSubjectdetails_nitStaging table? It would be helpful if you could share the list of unique indexes and fields in it.
Please find the below screenshot which contains the details of the table
Are you sure you don't have duplicates by RollNumber and LineId in StudentSubjectdetails_nit table?
The table StudentSubjectdetails_nit has only two records which I imported from the following XML file.
The records in the table StudentSubjectdetails_nit are as shown
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 658
André Arnaud de Cal... 468 Super User 2026 Season 1
Syed Haris Shah 333 Super User 2026 Season 1