Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Cached updates
Fri, Sep 16 2011 1:19 PMPermanent Link

Stefano Monterisi

I am working on cached update master-detail and I have troubles...
My scenario: Master Table A with 3 details B C D, all in editable grids ; I
can scroll A (query) and must see B C D (queries); When I can start (what
event) BegincachedUpdates, if user can edit directly A, B, C, o D in grids
(without pressing any button o function key gor edit, but only Save and
Abort buttons) ?
Please consider that I have to edit and post always the master record (for
calc sum fields) if I edit, insert or delete a detail...
If I apply Updates, I must call another BegincachedUpdates for prepare the
reedit of the same records?
If I call BegincachedUpdates in afterscroll event of master table, I must
call cancelCachedUpdates and BegincachedUpdates in loop, or a new
BegincachedUpdates discard the old one? (it seems that they are
cumulative....)
I hope that you understand my (poor) english, sorry.
Good Job,
Stefano Monterisi


Mon, Sep 19 2011 12:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Stefano,

<< When I can start (what event) BegincachedUpdates, if user can edit
directly A, B, C, o D in grids (without pressing any button o function key
gor edit, but only Save and Abort buttons) ? >>

You really can't start cached updates from a
BeforeInsert/BeforeEdit/BeforeDelete event handler on the detail tables.
You could do so on the master table's BeforeInsert/BeforeEdit/BeforeDelete
event handlers.

<< Please consider that I have to edit and post always the master record
(for calc sum fields) if I edit, insert or delete a detail...>>

You can't really post the master until the ApplyCachedUpdates is called, or
you risk having the master be out of synch with the detail.  Plus it is
always a good idea to wrap the post of the master and the application of the
detail's cached updates in a transaction.

<< If I apply Updates, I must call another BegincachedUpdates for prepare
the reedit of the same records? >>

Yes.

<< If I call BegincachedUpdates in afterscroll event of master table, I must
call cancelCachedUpdates and BegincachedUpdates in loop, or a new
BegincachedUpdates discard the old one? >>

You must call CancelCachedUpdates and then BeginCachedUpdates, otherwise
your detail tables will not contain the correct rows for the new master.

--
Tim Young
Elevate Software
www.elevatesoft.com
Image