How can I force a data reload of just the current record (for the form currently being browseed) ?
I am looking for a simple function that can be invoked from a method.
I do not want to lose the current found set and I do not want to relaod the current found set.
//Refresh record from database incase other programs did change the database record
//refresh the second record from current foundset (-1 can be used to refresh all records but is more expensive operation)
databaseManager.refreshRecordFromDatabase(foundset,2)
Unfortunately, the database-manager object is not accessible from plugins
From my plugin java code I would like to reload the current record.
The only way I can [almost] see to do this is along the following lines:
final IClientPluginAccess clientAccess = _clientPlugin.getClientAccess();
final IFormManager formManager = clientAccess.getFormManager();
final IForm currentForm = formManager.getCurrentForm();
//now, neither of these 2 functions is what I want and neither gives me the outcome I require, but they illustrate that it may be somwhow possible
currentForm.loadAllRecords();
currentForm.reLookupValues();
//what I do want is something like:
currentForm.refreshRecordFromDatabase()
//in fashion similar to the previous post
Form update fails with:
dbm.js_refreshRecordFromDatabase(fs,index);
Whether I invoke this on the event dispatch thread or a concurrent thread, the form UI is not updated. The user needs to invoke a found-set refresh (say, via a mode swap to designer and back to browse) - ugly.
I perform checks to ensure that the index and found-set before invoking the call, so the set and index values are good (ie. the user has not navigated away from the record or worse still into another found set).
If you are doing changes in the database directly via a server plugin, you could use IServerAccess.flushAllClientsCache to make clients reload records from a table.