Skip to main content

Notifications

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

Getting error Cannot create a record Data Entity. The record already exists. '2' 'Name of Data entity' record(s) inserted in staging

(0) ShareShare
ReportReport
Posted on by 162

Hi,

I have duplicated the GeneralJournalAccountEntryEntity as I need only few new and selective fields. But while exporting i get the following error

  

I have even checked if the staging has staging index, and it has. Please help me in resolving this.

  • Harshal Jain Profile Picture
    Harshal Jain 162 on at
    RE: Getting error Cannot create a record Data Entity. The record already exists. '2' 'Name of Data entity' record(s) inserted in staging

    I wasn't including the primary key while exporting. After I added it, I was able to export the data successfullly.

  • Harshal Jain Profile Picture
    Harshal Jain 162 on at
    RE: Getting error Cannot create a record Data Entity. The record already exists. '2' 'Name of Data entity' record(s) inserted in staging

    Hi Mohit,

    I ran the SQL scripts for both the enity and staging, it return 1. Also I deleted the staging, duplicated the same and added it in Entity, but got the same error. Any other suggestions please ?

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,552 Super User 2024 Season 1 on at
    RE: Getting error Cannot create a record Data Entity. The record already exists. '2' 'Name of Data entity' record(s) inserted in staging

    Hi Harshal, Have you duplicated staging table as well and changed data entity index? If you haven't duplicate staging table then try and update in data entity.

    Also, you can use below SQL script to check if there is duplicate records in data entity or staging table. In Group by fields, add index fields. If it returns greater than 1 for any record then there are duplicate records. You can modify the script to find duplicate records then.

    SELECT TOP 1 COUNT(RECID) AS KEYCOUNT 
    FROM SALESPOSTEDSALESPRICEJOURNALLINEENTITY
    GROUP BY TRADEAGREEMENTJOURNALNUMBER,LINENUMBER,DATAAREAID

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…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans