[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

645.0. "Audit for Entry Forms" by FILTON::HALLETT (Florabunda Surfin' Dudes) Thu May 07 1992 13:03

    Hi,
    
    Someone must have tried this somewhere ?!!...
    
    I need to create an audit file for any changes made to an entry form in
    edit mode, listing:
    
    OA$USER
    OA$DATE
    field_name (of only those changed)
    old_field_value (of only those changed)
    
    Other than putting some POST_FIELD functionality on every field (of a 3
    page entry form), I cannot think of anything else.  If I had to do
    this, wouldn't it cause some dreadfull performance problems ?
T.RTitleUserPersonal
Name
DateLines
645.1Easier way (but not necessarily acceptable)IOSG::SHOVEDave Shove -- REO-D/3CThu May 07 1992 13:206
    Wouldn't it be easier just to write out OA$USER, OA$DATE, the complete
    old record and the complete new record? Then run a program (later) to
    compare them and produce the audit of what changed?
    
    Just a thought,
    Dave.
645.2Other option (not necessarily better)HOTAIR::MADDOXWhen in doubt, change itThu May 07 1992 17:0144
You could do /PRE and /POST form qualifiers where the /PRE saves the 
current values of all fields on the form to temp symbols and the /POST
checks the current field values against those saved and writes the
field names of all fields which are different.

For example:

/PRE='xop "~~SAVE_VALUES~~"'
/POST='.if OA$FORM_DISPOSE eq 2 then xop "~~COMPARE_FIELDS~~"'

;;~~SAVE_VALUES~~;;

 get #FIELD1 = FIELD1\
 get #FIELD2 = FIELD2\
 .
 .
 .

;;~~COMPARE_FIELDS~~;;

 display Writing data to file...\
 force\
 text_file open OUTPUT FILE.NAME /write\
 get #CHANGE = "N"\
 .if #FIELD1 nes FIELD1 then
    get #CHANGE = "Y"\\
    text_file write OUTPUT "FIELD1"\
 .if #FIELD2 nes FIELD2 then
    get #CHANGE = "Y"\\
    text_file write OUTPUT "FIELD2"\
 .
 .
 .
 .if #CHANGE = "Y" then
    text_file write OUTPUT OA$DATE_NBS " " OA$USER\\
    text_file write OUTPUT "****************************"

Note: This is untested code - use at your own risk.

The advantage of Dave's approach is that this checking would not be done
while the user is waiting on it, but my guess is that unless your using
this form for data entry (i.e., in lieu of keypunch) the user won't 
be that annoyed with the delay.  Try it and see how significant it is on
your system.