Appending rows to a Grid whose data source is a Temporary table

Hello,

I am trying to append records to a grid whose datasource is a temporary table (E.g. when a use clicks on a button). To add a line, I would simply use the setTmpData() method on the grid table then refresh the grid; however, it replaces the grid’s contents every time, it doesn’t append it so I always have 1 record.

How can I append, not overwrite, records to a grid who’s datasource is a temporary table?

Thank you in advance!

Nevermind! The following works (although it would be nice if there was a more efficient way!):

void method()

{

Table origTable, newTable;

;

// Copy original contents

for ( origTable = Table_DS.getFirst();

origTable;

origTable = Table_DS.getNext())

{

newTable.clear();

newTable.BOMId = origTable.BOMId;

newTable.ItemId = origTable.ItemId;

newTable.ItemName = origTable.ItemName;

newTable.ziMessage = origTable.ziMessage;

newTable.insert();

}

// Append new record data

newTable.clear();

newTable.BOMId = “test2”;

newTable.ItemId = “test2”;

newTable.ItemName = “test2”;

newTable.ziMessage = “test2”;

newTable.insert();

Table.setTmpData( newTable);

Table_DS.executeQuery();

}