Is there a way to have getFoundSetUpdater(foundset) update all related child data.
For example, we have our main list based on orders table. There is a relation orders_to_order_items. We provide users a popupMenu that provides order_items fields to be ‘filled’. eg date item processed, date item sent
is there a way for us to get the foundset updater to update all of these related records?
This will create a JSFoundSet whose underlying query will user the parent JSFoundSet’s where clause and join the child records
It will perform well if you don’t need to iterate, i.e. setting all records to the same column values. Then it is a single UPDATE sql statement generated
In your case, something like this:
// get foundset for all items
var itemFS = databaseManager.convertFoundSet(orderFS, 'orders_to_order_items');
// get updater for items
var updater = databaseManager.getFoundSetUpdater(itemFS);
// update all matching records
updater.setColumn('date_item_processed', date1);
updater.setColumn('date_item_sent', date2);
var success = updater.performUpdate();
if(!success) {
// custom message
}