Delay Saving values on Grid

I have a 2E layout

  • on TOP it has a form that defines a customer (name, address, ect), which is connected to a MASTER table,

  • on BOTTOM it has a grid with order details, which is connected to a DETAILS table

There is a menu that has a “Save/Cancel” option. I only want to save to db when I hit the save option.

This is fine for the FORM/MASTER combination, but with the GRID/DETAIL, in order to stop it saving in realtime, I fill the grid via query, and then, if save is hit, I delete all DETAIL records relating to this order, and then write out NEW detail records according to what’s in the grid.

Unfortunately this means that all saved detail records get new uniqueID’s which is no good as I have other tables hanging off these ID’s.

What I need is a “save grid” option that would update the already existing rows, and save the new ones as new. How could I achieve that pls??

Thanks,

You can use existing dataprocessor solution with one addition, after initing dataprocessor you need to add

dp.setUpdateMode(“off”);

as result dataprocessor will collect all changes but will not send them to server automatically.
To force data saving you need to call

dp.sendData();

after which dataprocessor will save (update|insert|delete if necessary) all changes in database.
If some data was changed in row - its id will stay unchanged.

one word: FANTASTIC, well done, brilliant software … .Microsoft would NEVER have thought of something so simple and clever :wink: