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 Limits in D365FO

(0) ShareShare
ReportReport
Posted on by 66

Hi,

What is the ,maximum  limit for inserting records via recordinsertlist ?

So in the below case if my loop is 10000 times then will it run out ot memory supposing there are many heavy tables

 MyTable myTable;
     RecordInsertList insertList = new RecordInsertList(myTable.TableId);
     int recordsCurrentlyInserted, i, recordsToInsert = 125;
     ;
     for (i = 1; i <= recordsToInsert; i  )
     {
         myTable.value = i;
         recordsCurrentlyInserted = insertList.add(myTable);
         info(strfmt("%1 records added, %2 records currently inserted.",
              i,recordsCurrentlyInserted));
     }
     recordsCurrentlyInserted = insertList.insertDatabase();
     info(strfmt("%1 records added, %2 records currently inserted.",
         recordsToInsert,recordsCurrentlyInserted));

Does it consume memory and is there a way to execute it at server end .OR its just save data internally in some temp tables and executes it without conusming memory locations

Thanks,

VK

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,961 Most Valuable Professional on at

    There is no X++ on client anymore, therefore everything runs on the (web) server.

    Running it with many records shouldn't be a problem, because the system doesn't wait for all records. When it decides that enough records were added, it inserts them to DB, remove them from memory and starts collecting records again. It's not clear where things went wrong.

    But I don't understand your code. Why are you referring to recordsCurrentlyInserted inside the loop when the value is set only after the loop and therefore it'll always contain zero?

    Don't you have any code in insert() method of MyTable?

    Will it make any difference if you remove info() from the loop?

  • vicky1234 Profile Picture
    66 on at

    thanks Martin the code is one from msdn .

    I just wanted to understand the limit section  and if it intelligently inserts records when it is full then it will work for me.

  • Martin Dráb Profile Picture
    237,961 Most Valuable Professional on at

    Aha, I didn't get that it was a theoretically question; I thought you have a problem with some code. Luckily, I answered your question anyway. :)

    You can find slightly more details in RecordInsertList documentation.

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 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans