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


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 = Table_DS.getNext())



newTable.BOMId = origTable.BOMId;

newTable.ItemId = origTable.ItemId;

newTable.ItemName = origTable.ItemName;

newTable.ziMessage = origTable.ziMessage;



// Append new record data


newTable.BOMId = “test2”;

newTable.ItemId = “test2”;

newTable.ItemName = “test2”;

newTable.ziMessage = “test2”;


Table.setTmpData( newTable);