General X++ Development
What is the difference between `insert()`, `doInsert()`, and `insert_recordset` in X++?
What is the difference between insert(), doInsert(), and insert_recordset in X++?
1 answer
Write an answerThey are not interchangeable.
insert()runs the table's normal insert path.doInsert()writes the record while bypassing the table's overriddeninsert()method and related event handling.insert_recordsetis intended for set-based insertion of many records.
Use insert() by default.
Use doInsert() only when you intentionally need to bypass normal table insert logic and understand what you are skipping.
Use insert_recordset when the operation can safely be handled as a set.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer