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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Getting record already exists error for my custom tables when inserting new data.

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

I have custom table in which have inserted lot of data, now to move this data to other environment i generated sql script with data only option the script shows recid's

When i import xpo to other environment & run the data script , i can see everything just fine however while inserting new data via form i get 

"Cannot create a record in mycustom table.
The record already exists."

I suspect this is due to the fact that recid;s are getting created when importing data , please suggest a fix.

pastedimage1607025079028v1.png

pastedimage1607025243408v2.png

I have the same question (0)
  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at
    RE: Getting record already exists error for my custom tables when inserting new data.

    Hi Mav,

    RecIds are generated and stored in an internal table, so it's expected that you will have issues with RecId generation from new data as the next RecId value was not updated for your table.

    I would use existing tools to export\import data instead of SQL script to move data between instances like old school export\import or DIXF.

    docs.microsoft.com/.../export-data-to-another-instance-of-microsoft-dynamics-ax

    Also, you can try to fix RecId sequence in internal table

    stoneridgesoftware.com/.../

  • Suggested answer
    Martin Dráb Profile Picture
    236,879 Most Valuable Professional on at
    RE: Getting record already exists error for my custom tables when inserting new data.

    Importing data directly to database is a terrible idea. Never do it! You may ruin your environment.

    There are many reasons, one of them is that RecId are assign from a system sequence and now your data isn't in sync with it. The system assignes a new RecId from the sequence, but you alteady have that imported.

    You can use the Data Import/Export Framework to do the job in a correct way.

  • Mav Profile Picture
    on at
    RE: Getting record already exists error for my custom tables when inserting new data.

    DIXIF will be too much of effort

    DIEF was working fine , however when i just added a table to def group it started giving error "File did not contain any valid data"

    Only change between working DIEF & now not working DIEF is i removed & added table to defination group.

    I have restarted the ax services & yet getting same error, any ideas .

  • Sergei Minozhenko Profile Picture
    23,093 on at
    RE: Getting record already exists error for my custom tables when inserting new data.

    Hi Mav,

    What changes did you make before restart? Did you delete data imported via SQL script and imported it through DIEF?

  • Mav Profile Picture
    on at
    RE: Getting record already exists error for my custom tables when inserting new data.

    Here is the sequence

    1>Ran sql script to add data into table

    2>Created dat file using DIEF Export

    3>Truncated the tables used in sql script.

    4>Imported dat file using DIEF import

    5>Realized that table is missing in defination group used in DIEF.

    6>Change definition group to add the table

    7>Exported new DAT file & BIN file

    8>Trying to import get ""File did not contain any valid data" error

    9>Restarted Ax services

    10 >Retry & got same error.

  • Mav Profile Picture
    on at
    RE: Getting record already exists error for my custom tables when inserting new data.

    Issue resolved by rebooting Ax.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

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

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 588

#3
Martin Dráb Profile Picture

Martin Dráb 542 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans