Alpha Video Training
Results 1 to 3 of 3

Thread: Audit Trail

  1. #1
    Member
    Real Name
    D.Chiasson
    Join Date
    Jan 2004
    Location
    West Coast of Canada
    Posts
    632

    Default Audit Trail

    Is there a way that you can show the USER NAME when you view the audit trail text on a data file?

    The text shows date, time, record no, file what was changed etc. but NO user so that makes it very hard to trackdown WHO made the change.

    Record number 80
    Changed on: 09/21/2004 at: 16:38:07
    ---------------------------------------------------------------------
    Work->SIGNOFF
    Old value:
    New value: 100
    Work->PRIORITY
    Old value:
    New value: HIGH
    =====================================================
    Record number 80
    Changed on: 09/21/2004 at: 16:52:29
    --------------------------------------------------------------------
    Work->WORKSTAT
    Old value: OPEN
    New value: HOLD

    ..........

    In the startup script, the variables are assigned & also whether that data file has the audit trail button checked....

    '----------------------------------------------------------------
    'Assigning Audit Trail Variables
    '----------------------------------------------------------------
    dim global AUDITMACHINE as L
    AUDITMACHINE = .T.
    dim global AUDITPART as L
    AUDITPART = .T.
    dim global AUDITVENDOR as L
    AUDITVENDOR = .T.

    ...etc

    Thanks.

    DeWayne

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,304

    Default

    DeWayne,

    Dr. Wayne's book, "Xbasic for Everyone" contains a discussion / example illustrating a more complete audit trail. I don't think it's possible to modify the behavior of the built in functions. I think you're going to have to create your own, and Dr. Wayne's discussion is very helpful.

    -- tom

  3. #3
    Member John Gamble's Avatar
    Real Name
    John Gamble
    Join Date
    Jan 2001
    Location
    Newmarket, ON Canada
    Posts
    886

    Default

    DeWayne

    I use the following to create an audit trail. See attached screen shots.

    The only caveat is that Alpha seems to interpret certain changes as deletes (for audit purposes only?).

    Fields required : Table Definition (To each table requiring an audit file)

    Add_User: Default: USER_NAME() (A5 predefined field name)
    Add_Date: Default: Date()
    Add_Time: Default: Time()

    Chg_User: (Calculated)
    CASE(
    ALLTEXT() = ALLTEXT_INITIAL(),CHG_USER,
    ALLTEXT() <> ALLTEXT_INITIAL() .AND. CHG_USER = USER_NAME(),(USER_NAME()+"*"),
    ALLTEXT() <> ALLTEXT_INITIAL() .AND. CHG_USER <> USER_NAME(),USER_NAME())

    An * is added (or deleted) to the user name, if the record has been changed. This forces the audit program to recognize a change to the user name even if it was the same user.
    Changed record audit trail only prints the fields actually changed.

    Chg_Date: (Calculated)
    IF(ALLTEXT() <> ALLTEXT_INITIAL(),DATE(),CHG_DATE)

    Chg_Time: (Calculated)
    IF(ALLTEXT() <> ALLTEXT_INITIAL(),TIME(),CHG_TIME)


    Events: Record Events: Can Save: (Adds, Changes)
    Insert :Addin.run("audit_trail")

    Events: Record Events Can Delete: (Deletes)
    Insert: addin.run("audit_trail_deleteRecord")

    Note: Adding to one field duplicates to all fields automatically.

    John

Similar Threads

  1. Audit Trail Anomaly
    By John Gamble in forum Alpha Five Version 6
    Replies: 3
    Last Post: 12-22-2005, 05:45 PM
  2. User Name in Audit Trail
    By Melvin Davidson in forum Archived Wishlist
    Replies: 0
    Last Post: 02-28-2005, 12:48 PM
  3. Audit Trail
    By Chris Tramontana in forum Alpha Five Version 5
    Replies: 5
    Last Post: 04-01-2003, 09:22 AM
  4. Audit Trail
    By Nicholas Lawson in forum Alpha Five Version 5
    Replies: 5
    Last Post: 10-16-2002, 11:48 PM
  5. Audit Trail
    By nick marodis in forum Alpha Five Version 4
    Replies: 0
    Last Post: 05-16-2000, 07:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •