Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 2 of 2 total |
OnBeforePost |
Tue, Apr 10 2007 4:35 PM | Permanent Link |
"Petrus van Breda" | Hi
I have an application that will generate Reference Number. When the user Save the Record I will add teh reference number in OnBeforePost. The problem is that if a user get an error on his/her input ir a required field the number will not increase, but when they abandon the record the number are lost. How can I check for any application errors and none is received only then add the reference number. Thanks Petrus |
Tue, Apr 10 2007 5:25 PM | Permanent Link |
Sean McCall | Petrus,
If you are using a table to generate the reference number, do everything within a transaction. If it fails, the reference number generation will be rolled back when you call Database.Rollback. If you use a non-database means to get your reference number, use a try-except block around the transaction or post and reset the number before you roll it back. Alternatively, you could also check the required fields yourself before you generate the reference number to make sure that all required fields are entered. Downside is that this would still skip a reference number if some other error came up. Sean Petrus van Breda wrote: > Hi > > I have an application that will generate Reference Number. When the user > Save the Record I will add teh reference number in OnBeforePost. The problem > is that if a user get an error on his/her input ir a required field the > number will not increase, but when they abandon the record the number are > lost. How can I check for any application errors and none is received only > then add the reference number. > > Thanks > > Petrus > > |
This web page was last updated on Wednesday, April 24, 2024 at 11:07 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |