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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

RecordInsertList.add(Common) Method error

(0) ShareShare
ReportReport
Posted on by 12
Hi,
 
I'm using RecordInsertList to insert records.
There is same record has existed in DB, so the error should be throw when insertDatabase() called.
I understand that the add method only insert buffer to memory, but the method add throw error Microsoft.Dynamics.Ax.Xpp.DuplicateKeyNotRecoveredException
 
 
 
I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,055 Most Valuable Professional on at
    No, your understand isn't correct. You believe that if you add a million records, the systems holds all of them in memory and that it makes a single insert with million rows. That's not what RecordInsertList is for.
     
    RecordInsertList adds records in bathes (if possible), but not necessarily in just a single batch. For example, if decides to insert records in a batch of 100 records, there are inserts to DB when you call add() for the 100th record, 200th record and so on. insertDatabase() just ensures that remaining records, that haven't been inserted yet, are inserted too.
     
    Note that you should consult the documentation if you're unsure about how something works. In this case, you can find it under RecordInsertList Class.
  • Community member Profile Picture
    12 on at
    Thank Martin,
     
    Ive already read document for every method of class, and a lot of other post on google before posted a question, but I cant guess the add method do insert by batch of records.
    (the google translate "flush" = "delete", my bad).
     
  • Martin Dráb Profile Picture
    239,055 Most Valuable Professional on at
    It's not the most detailed explanation, but the information is there.
     
    You see that "The add method can flush records to the database [...]" and "insertDatabase method [is used] to insert all remaining records".
     
    You can also read that "Records are inserted only when the kernel finds the time appropriate, but no later than the call to the insertDatabase". This contradicts your original assumption, which can be formulated like "Records are inserted only when insertDatabase is called".
  • Community member Profile Picture
    2 on at
    Same problem here.
    If I skip RecordInsertList the problem doesn't appear, so it is not related to the data itself.
    Always come at record count 63 not depends the field values.
    Really annoying.
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 669

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 445 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 331 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans