Hello
Following the previous instructions (http://dynamicsuser.net/forums/p/20394/93334.aspx#93334), I have succeeded in copying data between two tables
This is what I am doing, and was wondering if I need to change the company twice to insert data, once for adding record to the table buffer, and then to add it into the database.
void copyEachTable(int tableId)
{
Common tableFrom, tableTo;
DictTable dictTable;
RecordInsertList recordInsertList ;
;
recordInsertList = new RecordInsertList(tableId);
dictTable = new DictTable(tableId); // need this to make a reocrd we can loop through.
sysTableBrowser.run(tableId);
tableFrom = dictTable.makeRecord();
// do we have to do this to make sure the insert is in the correct company ???
changeCompany(companyTo)
{
tableTo = dictTable.makeRecord();
}
// loop through the source
while select tableFrom
{
buf2Buf(tableFrom, tableTo); // copy the source
recordInsertList.add(tableTo); // put into RIL
}
// or this is sufficient ???
changeCompany(companyTo)
{
if(tableTo.validateWrite())
{
recordInsertList.insertDatabase(); // commit to the DB
}
}
}
Thank you
VB