rollbackEditedRecords strangeness

Questions, tips and tricks and techniques for scripting in Servoy

rollbackEditedRecords strangeness

Postby patrick » Fri Apr 29, 2011 12:21 pm

Hi,

I have a record in a transaction and add related records in a separate dialog. The dialog has a save and cancel button. The cancel button cannot rollback the transaction, because then my master record is also gone. To only "rollback" the single related record, I thought I use rollbackEditedRecords(). That works fine for the first related record I add. New record created, dialog opens, cancel button closes dialog and record is gone. It does not, however, work for any other record I add to the main record. In that case, getEditedRecords() also returns an empty array...

Is there something I do wrong?

Thanks
Patrick
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: rollbackEditedRecords strangeness

Postby patrick » Fri Apr 29, 2011 12:35 pm

I noticed that the record's data is cleared, but the record itself is still there...
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: rollbackEditedRecords strangeness

Postby jcompagner » Fri Apr 29, 2011 1:37 pm

if you create a new record that is not yet saved to the database
and you call databaseManager.rollbackEditedRecords(record) then that records should be removed from its foundset.

if you have a case where it doesn't do that please make a case.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: rollbackEditedRecords strangeness

Postby patrick » Fri Apr 29, 2011 1:50 pm

I have a case where it does not work like that, yes.

Tried to create a sample, but there it works. Will investigate further...
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany


Return to Methods

Who is online

Users browsing this forum: No registered users and 5 guests