Tuesday, 15 April 2014

User RecordInsertList

 int                             i;
    MyInvoiceInsertOverriden        myInvoiceRecord;
    int                             startTime, endTime;

    // Notice that the second parameter is being passed as true to inform that
    // the insert method must be skipped
    RecordInsertList invoicesToBeInserted = new RecordInsertList(tableNum(MyInvoiceInsertOverriden
    for (i = 0; i < 10000; ++i)
    {
        myInvoiceRecord.InvoiceAmount = (i + 1) * 100;
        myInvoiceRecord.CurrencyCode = 'REA';
        myInvoiceRecord.Qty = (i + 1) * 10;
        myInvoiceRecord.InvoiceId = int2str(i + 1);

        invoicesToBeInserted.add(myInvoiceRecord);
    }

    invoicesToBeInserted.insertDatabase();

No comments:

Post a Comment