Hi,
Problem description:
Two OracleDataSets: odsMaster and odsDetails in master-detail relationship. The programm works in the way that odsDetails can be modified only when odsMaster is in dsEdit/dsInsert mode.
odsMaster.CachedUpdates := False
odsDetails.CachedUpdates := True
for both datasets CommitOnPost := False
Event handler odsMaster.AfterPost calls:
odsDetails.Session.ApplyUpdates([odsDetails], False);
odsDetails.Session.CommitUpdates([odsDetails])
Event handler odsMaster.BeforeCancel calls:
odsDetails.CancelUpdates
Everything works fine except one:
When odsDetails is in dsInsert/dsEdit mode and user does odsMaster.Cancel, odsDetails.Post (well, somewhere internally) gets called and user can occasionally get some validation exception because user didn't finish entering data. I checked that post is made with event handler odsDetails.BeforePost. In my understanding, odsDetails.Cancel should be called if I call odsMaster.Cancel. Right? I cannot call it manually because odsDetails.Cancel happens before odsMaster.BeforePost event.
How should I go about this?
Thanks in advance,
Alex
Problem description:
Two OracleDataSets: odsMaster and odsDetails in master-detail relationship. The programm works in the way that odsDetails can be modified only when odsMaster is in dsEdit/dsInsert mode.
odsMaster.CachedUpdates := False
odsDetails.CachedUpdates := True
for both datasets CommitOnPost := False
Event handler odsMaster.AfterPost calls:
odsDetails.Session.ApplyUpdates([odsDetails], False);
odsDetails.Session.CommitUpdates([odsDetails])
Event handler odsMaster.BeforeCancel calls:
odsDetails.CancelUpdates
Everything works fine except one:
When odsDetails is in dsInsert/dsEdit mode and user does odsMaster.Cancel, odsDetails.Post (well, somewhere internally) gets called and user can occasionally get some validation exception because user didn't finish entering data. I checked that post is made with event handler odsDetails.BeforePost. In my understanding, odsDetails.Cancel should be called if I call odsMaster.Cancel. Right? I cannot call it manually because odsDetails.Cancel happens before odsMaster.BeforePost event.
How should I go about this?
Thanks in advance,
Alex