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

RecordInsertList. Insert Database()

(0) ShareShare
ReportReport
Posted on by 30

Hi team,

I came to know the new concept Insert Database. before I used Insert_Recordset.

whst is the difference between  Insert_Recordset. and InsertDtabase ?

Kindly elaborate me pls how InsertDtabase wiil work ? and when it exactly required to use?

Pls give me more shed on this.

thanks!

I have the same question (0)
  • Martin Dráb Profile Picture
    236,974 Most Valuable Professional on at
    RE: when to call Insert Database.

    It's impossible to answer before you explain what you mean by "the new concept Insert Database". Don't you actually mean insertDatabase() method of a class and you forgot to mention which class it is? My guess is that you mean RecordInsertList. If so, you'll find a plenty of information on the internet, because it's nothing new.

    It's a pity that you still don't know how to describe your question after all the years here, the hundred threads and all the advice you got.

  • Verified answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: when to call Insert Database.

    Hi,

    Insert_Recordset is a keyword in D365 which will be used to insert multiple records at a time. For example, you are looping all the records and inserting records one by one into table using while select, instead of that you can use Insert_Recordset which will increase performance.

    InsertDatabase is a part of RecordInsertList functionality.

    InsertDatabase will be called after you add all the records to the table buffer and finally call the InsertDatabase.

    InsertRecordset is mainly used to increase performance. If you write normal insert, it will call database for each insert.

    But if you use InsertRecordSet one single call to the database is enough to all the records that is using InsertDatabase method.

    Table1 tempTable1;
    Table2 tempTable2;
    RecordInsertList insertList = new RecordInsertList(Tablenum(Table2));
    While select * from temptable1
    {
        tempTable2.Field1 = temptable1.Field1;
        //add all the buffer value to RecordInsertList using add methiod.
        insertList.add(tempTable2);
    }
    //after the completion of while select and adding all the buffer values to RecordInsertList
    call the insertDatabase method to insert all the record at one database call.
    insertList.insertDatabase();

    Thanks,

    Girish S.

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... 650 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 582 Most Valuable Professional

#3
CU05031448-0 Profile Picture

CU05031448-0 526

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans