With two tables that are exactly the same, how can the found set of one table be moved over to the other table without exporting and importing?
I suspect that it can be done by building an array and then moving the contents of the array over to the other table. If someone can provide an example of how this can be done it would be greatly appreciated.
I have done this on several occasions. I created a field in the table I am pushing the records to to act a the FK. Then just use the relationship node to transfer the data
//Define Validation
//Add reviewed by info before transfer
//Add Review Date
date_reviewed = application.getTimeStamp();
accountstemp_to_accounts_by_temp_id.newRecord();
forms.AccountingRecAcctProfile.controller.saveData();
//Capture New Account Number
globals.Integer5 = accountstemp_to_accounts_by_temp_id.account_id;
Thank you for your reply. In my case I will only be moving about 5 columns, but will have as many as 500 rows to copy from table 1 to table 2.
For this reason I thought that assigning the data to an array would be faster. However, I am having trouble both with the syntax of building the array and with what to do with the array after it is built. In other words, how to move the data from the array back into the second table.
If you simply loop over your 500 records and create 500 records in the other table, it will fire 500 inserts, but that shouldn’t really matter. I suppose that you don’t need to use this feature every two minutes…
The example of copyMatchingColumns in the new 2.2 Help file is:
var srcRecord = foundset.getRecord(1);
var destRecord = foundset.getRecord(2);
databaseManager.copyMatchingColumns(srcRecord,destRecord,true);
How can I use this to copy 500 rows from Table 1 to Table 2 if both tables have three columns named: id, description and value? I suspect it involves use of arrays. If anyone can provide sample code it would be greatly appreciated.