Ok, I’ve been trying to avoid this question since I feel it should have an obvious response, but the answer continues to elude me
Say I want to add records to a foundset not related to the form’s foundset. What’s the “proper” way to do this?
So far, I’ve come up with:
var fsTable2 = databaseManager.getFoundSet(databaseManager.getDataSourceServerName("myConn"), "Table2");
fsTable2.newRecord();
fsTable2.column1 = 'Hello';
fsTable2.column2 = 'world';
databaseManager.saveData(fsTable2);
What makes feel uneasy about that is the I’m not getting the column name on the intellisense (autocomplete).
Another approach I’ve come up with is creating a relationship between the form’s main table (Table1) and the table I want to insert records to (Table2), using a dummy global variable, that way I can go about it like this:
table1_to_table2.newRecord();
table1_to_table2.column1 = 'Hello';
table1_to_table2.column2 = 'world';
databaseManager.saveData(table1_to_table2);
With this approach I do get intellisense, but it feels somewhat dirty, wouldn’t you agree?
Please, feel free to share your approach on this however obvious it may seem.
Regards,
jd2p