Hi,
Got the following setup:
- button on a form
- when button is clicked:
- A DataBase transaction is started
- A new record is created
- The new record is shown in a formindialog (the form is in record view)
- on the form in dialog is a cancel button
- when the cancel button is clicked, the following happens
- the formindialog has to be closed
- the transaction needs to be rolled back
Now the issue is the following:
whether or not I roll back the transaction first and then close the formindialog or do it vise versa, Servoy tries to save the new record. This causes an error, since some of the columns of the table of the new record are defined as not nullable and no value has been filled yet for it.
This in no issue prior to RC3 as Servoy would fill 0 or ‘’ into the columns, but since RC3 this doesn’t happen anymore.
How should I solve this?
Paul
Hmm…quick fix/workaround?
Set default values in Servoy’s column definitions.
Hmmm… thought of that, don’t like it ![Confused :?]()
Question is: Am I doing something wrong, or is this a bug. Or is this something that comes with the fact that Servoy doesn’t fill 0 or ‘’ anymore into those not nullable field and is the only way to get rid of the errormessage is your suggestion?
Paul
you could try to disable auto save (see application) and then when you press cancel you delete the current “new” record else you do save youre self.
Allready had AutoSave disabled, that didn;t solve the problem.
Added the deleteRecord to my Cancel method and now it works.
So, is this the way to go, or is there an issue with application.closeFormDialog();, that does a save to the DB, eventhough the autosave is disabled?
Paul
yes it will save. the autosave disabled only is for focus lost auto save. When going to another form or when going to another record (and edit that one) wil save the record.