Re: Forms 4.5: "Record updated by another user" and more...

From: Dave Mausner <dmausner_at_brauntech.com>
Date: 1997/06/27
Message-ID: <5p11pb$ive$1_at_client3.news.psi.net>#1/1


In article <E1D7EA37_at_MHS>, Stefan.Nilsson_at_ellips.sydkraft.se wrote:
>A form is based on a table with a NOT NULL column that holds audit
>information ("createdby"). An insert is done in the form (where the
>audit field is not visible) and "createdby" is set in that record in a
>database trigger. Everything is fine, so long.
>The record (still up in the form) is then updated immediately in the
>form which causes the message "Record has been updated by another user"
>to display (since a change was done in the databse trigger) , but the
>update is processed to the database anyway. Is there anyway to avoid
>this message ?

okay, the problem is that forms checks the database to see if the record in the database has been modified prior to forms having a chance to place the row lock. now if the database does not match the form, then it assumes that someone changed the database before it changed the form. that someone is you.

in general, you must not change a column value by using a database trigger while the form has a copy of that same record. the right way to add audit info is by: (a) having a pre-insert/pre-update trigger pair that modify the form fields, or (b) having insert-update database triggers modify the columns which are NOT stored in the form. that way, no change takes place which forms deduces to be caused by an external agency.

--
Dave Mausner, Consulting Manager, Braun Technology Group, Chicago.
Received on Fri Jun 27 1997 - 00:00:00 CEST

Original text of this message