Interesting. Must remember this. However I don't want to play with the new primary key field value, but do need to identify the original values. Then must be held somewhere, but how do I get to them?
Paul > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of > Carlos Anjos > Sent: 24 January 2003 18:25 > To: Henner Kollmann > Cc: [EMAIL PROTECTED]; dbf > Subject: Re: AW: [dbforms] RE: Interceptor - preUpdate - > "feature" should be documented > > > Apparently so. I just found out the hard way. > Apperently if a field is marked with isKey="true" in the config file, > the preDelete and preUpdate methods disregard any changes to it. > I had a situation where i did some processing in the preDelete method > and then I wanted to allow the operation, but on a different row. > So I changed the values in the fieldValues hashtable, but still the > orginal row got deleted. > After banging my head for where in my code the error was, I finally > understood that dbforms was ignoring the change to that attribute. > A friend of mine went through dbforms deleteEvent code and confirmed > that. > > Should/could this behaviour be changed ? > If not, it should be documented in the users guide that you cannot > change the key values with interceptors !!! > > Carlos. > > Henner Kollmann wrote: > > > > With the primary key!!!! Never change it - otherwise the > update will not > > work! > > > > Regards, > > Henner > > > > > > > > Hi Carlos > > > > > > The problem is that the primary key may be being updated. > > > Thus I need to get a reference to the table row being updated > > > but the fieldValues hash may not hold the original primary > > > key. I can't help thinking that the innards of dbforms must > > > be able to identify the row to be updated, else how does it do it? > > > > > > Many thanks for responding > > > > > > Paul > > > > > > > > > > > Hi Paul. > > > > Perhaps you could get from the fieldValues hashTable some id > > > > of the row you are tying to update and do some sql query using the > > > > connection provided, to find what the current values are. > > > > > > > > Regards, > > > > Carlos. > > > > > > > > > > > > > > Dear Team > > > > > > > > > > > > I have a preUpdate interceptor installed and the fieldValues hash > > > > > > tells me the new (updated) column values. > > > > > > > > > > > > Is there a way to get to the current (pre update) column values > > > > > > for the target row? > > > > > > > > > > > > I need this information to decide if the update should proceed. > > > > > > > > > > > > Many thanks > > > > > > > > > > > > Paul > ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ DbForms Mailing List http://www.wap-force.net/dbforms
