General X++ Development

What is the difference between `insert()`, `doInsert()`, and `insert_recordset` in X++?

Asked by Sunny Vasty· Aug 13, 2026· 1 answers

What is the difference between insert(), doInsert(), and insert_recordset in X++?

SSunny Vasty75 reputation · answered Aug 13, 2026

They are not interchangeable.

  • insert() runs the table's normal insert path.
  • doInsert() writes the record while bypassing the table's overridden insert() method and related event handling.
  • insert_recordset is 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.