RecordInsertList Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The RecordInsertList class provides array insertion capabilities in the kernel.
public ref class RecordInsertList : Microsoft::Dynamics::Ax::Xpp::XppObjectBase
[Microsoft.Dynamics.Ax.Xpp.KernelClass]
public class RecordInsertList : Microsoft.Dynamics.Ax.Xpp.XppObjectBase
[<Microsoft.Dynamics.Ax.Xpp.KernelClass>]
type RecordInsertList = class
inherit XppObjectBase
Public Class RecordInsertList
Inherits XppObjectBase
- Inheritance
- Attributes
Remarks
This class lets you insert more than one record into the database at a time, which reduces communication between the application and the database. Records are inserted only when the kernel finds the time appropriate, but they are inserted no later than the call to the insertDatabase, add, and insertDatabase methods. The RecordInsertList.add and RecordInsertList.insertDatabase methods return the accumulated number of records that are currently inserted, so that you can keep track of when the records are actually inserted. The array insert operation automatically falls back to classic record-by-record inserts when non-SQL based tables are used (for example, temporary tables) or when the insert method on the table is overridden (unless it is explicitly discarded). The RecordInsertList class resembles the RecordSortedList class, but it has built-in client/server support (it automatically packs data from one tier to another when this is required) and lacks the sort order features that are available in the RecordSortedList class.
The following example uses the RecordInsertList class to copy a bill of materials (BOM) from one BOM to another.
void copyBOM(BOMId _FromBOM, BOMId _ToBOM)
{
RecordInsertList BOMList;
BOM BOM, newBOM;
BOMList = new RecordInsertList(tableNum(BOM));
while select BOM
where BOM.BOMId == _FromBOM
{
newBOM.data(BOM);
newBOM.BOMId = _ToBOM;
BOMList.add(newBOM);
}
BOMList.insertDatabase();
}
Constructors
Fields
kernelClass | (Inherited from XppObjectBase) |