Hi,
I would like to access a record that was just created, but not saved in the database, through other foundset instance, different then the one where it was created.
// file.js
function testFoundSet() {
databaseManager.setAutoSave(false);
var foundSetA = databaseManager.getFoundSet("server", "table_test");
foundSetA.loadRecords("some sql query");
foundSetA.newRecord();
foundSetA.field1 = 12;
foundSetA.field2 = "Some text";
return globals.processData(foundSetA.record_id);
}
// globals.js
function processData(recordId) {
var foundSetB = databaseManager.getFoundSet("server", "table_test");
foundSetB.loadRecords(recordId);
// Here the foundSetB will have 0 records.
// What I would like is to have the new record that was just added, but not saved.
}
I know I could pass the foundSetA to the globals.processData, but let’s say I can’t do that. Or how can I do it in case the call is made from a function in a table calculation file, where the foundSetA is the table itself and actually it would miss from the code because we are inside the foundset there? Something like this:
// table_test_calculations.js
function test_calculated_value() {
// databaseManager.setAutoSave(false); and foundSetA.newRecord(); were already called from another place
return globals.processData(record_id);
}
This should be possible and it’s really useful in the same client. How can it be achieved?
Thanks,
Bogdan.