Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Inserts all records, that have not already been inserted, in the current RecordInsertList object.
Syntax
public int insertDatabase()
Run On
Called
Return Value
Type: int
An integer that represents the total number of records inserted.
Remarks
The RecordInsertList.add method flushes records to the database whenever it will speed up performance.
Examples
The following example uses the RecordInsertList class to copy a bill of materials (BOM) from one BOM to another. The RecordInsertList.add method is used to add all the records in the BOM to the RecordInsertList class before a final call is made to the insertDatabase method to insert all remaining records.
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();
}