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

Notifications

Announcements

No record found.

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
    237,844 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
    237,844 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 672 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 289 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans