Re: What items were changed?
Date: 19 Oct 1999 15:52:42 GMT
Message-ID: <01bf1a42$317cf620$190114c1_at_sister.grant.UUCP>
You can use something like the following (I'm not 100% sure about niceties)
Curr_Item_Name := GET_BLOCK_PROPERTY(Your_Block_Name, FIRST_ITEM);
Last_Item_Name := GET_BLOCK_PROPERTY(Your_Block_Name, LAST_ITEM);
LOOP
IF GET_ITEM_PROPERTY(Curr_Item_Name, DATABASE_VALUE) <>
NAME_IN(Curr_Item_Name) THEN
--Actions for changed items...
END IF;
EXIT WHEN Curr_Item_Name = Last_Item_Name;
Curr_Item_Name := GET_ITEM_PROPERTY(Your_Col_Name, NEXT_ITEM);
END LOOP:
If you want to store the history of changes, it's better to use
database trigger
AFTER UPDATE, comparing :old and :new values, to reinsure audit of all
changes,
not only of those made by Your form.
Chris Jordan <mail_at_mailer.com> wrote in article
<MBdO3.4658$%E3.165360_at_wbnws01.ne.mediaone.net>...
: I have a form which records data into a COMPANY table. Now, say if
there is
: some modification that needs
: to be made on CompanyX. CompanyX just got sold and is now called
CompanyY.
: So the user opens the
: form, and changes the company name from CompanyX to CompanyY, and
then saves
: the form. Is there
: any way for us to track the fact that a change was made. And it
could be
: any type of change that was made on
: the record, not just name change?
:
: I was thinking of creating a separate table called
: COMPANY_HISTORY(date,companyid,fieldname,
oldfieldvalue,newfieldvalue).
: Then when-update-item fires, storing all the 17 field values of the
current
: record into 17 temporary global variables. And when post-commit
fires,
: comparing each of the 17 fieldvalues
: with what is stored in those global variables. If any item doesn't
match,
: add it onto the COMPANY_HISTORY
: table. It seems like this can work, but rather clumsily, since I
have to
: enter 17 if-then comparisions for each
: field. Is there better solution to track the changes that are made
onto a
: database record (from the form)?
:
: The idea is so that when the users are going thru the companies, they
can
: click on the history button, and up comes
: a list showing exactly what was modified on this company, who
modified it,
: and when was it modified.
Received on Tue Oct 19 1999 - 17:52:42 CEST