RecordSortedList.new Method

Initializes a new instance of the Object class.

Syntax

public void new(TableId tableId, [Common table])

Run On

Called

Parameters

Remarks

The list can contain records of the type that is specified by the tableId parameter.

Examples

The following example uses a RecordInsertList object to insert three records in a single database operation.

{ 
    RecordSortedList recordSortedList; 
    CustTable        custTable; 
  
    recordSortedList = new RecordSortedList(tablenum(CustTable)); 
    recordSortedList.sortOrder(fieldnum(custTable,AccountNum)); 
    ttsbegin; 
  
    // Prepare record #1 for insertion. 
    custTable.AccountNum = '1000'; 
    custTable.CreditMax = 10000.0; 
    recordSortedList.ins(custTable); 
  
    // Prepare record #2 for insertion. 
    custTable.AccountNum = '2000'; 
    custTable.CreditMax = 500.0; 
    recordSortedList.ins(custTable); 
  
    // Prepare record #3 for insertion. 
    custTable.AccountNum = '3000'; 
    custTable.CreditMax = 9999999.9; 
    recordSortedList.ins(custTable); 
  
    // All 3 records inserted in one database operation. 
    recordSortedList.insertDatabase();   
    ttscommit; 
}

See Also

RecordSortedList Class

RecordInsertList Class