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

(0) ShareShare
ReportReport
Posted on by 70

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

  • Verified answer
    Martin Dráb Profile Picture
    240,862 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
    70 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
    240,862 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 528 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 424 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 374

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans