Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 3 of 3 total |
AfterDelete trigger - CurrentRecord empty? |
Fri, Oct 12 2007 11:47 AM | Permanent Link |
Chris Erdal | I'm getting more and more organised, and am moving bits of code from all
over the place to database triggers, which I see as a GOOD THING ! In the afterDelete trigger I'd like to recalculate some totals in the Master table when a Detail row is deleted, but when I use the CurrentRecord fields as I already do in the AfterInsert/AfterUpdate triggers, the field values are empty. Is this my fault, or is a parameter with a load of empty fields really sent with the event handler? If the latter, I suppose I can always use the BeforeDelete trigger instead, inside a transaction, but would it be possible to send the values of the just-deleted fields instead? -- Chris (XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3) |
Fri, Oct 12 2007 6:31 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Chris,
<< Is this my fault, or is a parameter with a load of empty fields really sent with the event handler? >> Use the TField.OldValue property for the TFields when you access them via the CurrentRecord object. Since the row was deleted, there really is no "current" value. -- Tim Young Elevate Software www.elevatesoft.com |
Sun, Oct 14 2007 8:58 AM | Permanent Link |
Chris Erdal | "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in
news:A7691509-F221-4A64-8F37-59F6A456150D@news.elevatesoft.com: ><< Is this my fault, or is a parameter with a load of empty fields >really > sent with the event handler? >> > > Use the TField.OldValue property for the TFields when you access them > via the CurrentRecord object. Since the row was deleted, there really > is no "current" value. Do-o-oh. Things are so self-evident, once someone's explained them to you ... Thanks! -- Chris (XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3) |
This web page was last updated on Tuesday, April 23, 2024 at 08:10 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |