Displaying audit details for an object ID

Contains tips for configurators working with Aware IM
Post Reply
wings
Posts: 133
Joined: Mon Oct 20, 2008 7:59 am
Location: Australia

Displaying audit details for an object ID

Post by wings »

I have created an object called Audit with the following attributes:

Action > Choices: Insert, Update, Delete, Viewed
Description
MadeBy
ModeOn
ObjectID
ObjectName

On each BO I have three rules (For BO Activity):

Audit_New
If Activity IS NEW Then
CREATE Audit WITH Audit.Action='Insert',Audit.Description=GET_CHANGES(Activity),Audit.MadeBy=LoggedInRegularUser.LoginName,Audit.ObjectName='Activity',Audit.ObjectID=Activity.ID


Audit_Changed
If Activity WAS CHANGED Then
CREATE Audit WITH Audit.Action='Update',Audit.Description=GET_CHANGES(Activity),Audit.MadeBy=LoggedInRegularUser.LoginName,Audit.ObjectName='Activity',Audit.ObjectID=Activity.ID


Audit_Delete
If Activity WAS CHANGED AND Activity.Status='Deleted' Then
CREATE Audit WITH Audit.Action='Deleted',Audit.Description=GET_CHANGES(Activity),Audit.MadeBy=LoggedInRegularUser.LoginName,Audit.ObjectName='Activity',Audit.ObjectID=Activity.ID


I now want to add a button to the activity form to allow the user to see the audit for the current object.

How do I do this?

My first thoughts where to:

Add an operation for the form called 'Audit' which runs a process called 'aud_display' which does the following:

FIND Audit WHERE Audit.ObjectID=?'Object ID' ORDER BY Audit.MadeOn
VIEW Audit


I put in the form operation, Process input 'Address' with value 'Address.ID'

But this dosn't seem to do anything and leaves a box saying 'Executing'


How have other users implemented displaying the audit details for an object?
Using 4.8 Build 1266
wings
Posts: 133
Joined: Mon Oct 20, 2008 7:59 am
Location: Australia

Post by wings »

ok, if anyone is interested this is how I managed to get an audit search going on a business object form.

For each BO (say Address)

1. create a query (aud_Search_Address)
---in the WHERE put Audit.ObjectID=Address.ID
---order by Address.MadeOn.
---In Display results I display Action, MadeOn, ObjectName, Description (Expanded checked).
---The only operation I have is 'View'

2. On the BO add to your form an 'Operation invoked from the form'
---Add 'Auditing', Operation type 'Run Query'
---select aud_Search_Address

If anyone has an easire way to do this let me know
Using 4.8 Build 1266
NBDAB
Posts: 39
Joined: Sat Oct 10, 2009 4:42 pm

Wonderful

Post by NBDAB »

Wings,

Great Tip!

If we expand on this further we will be sure to post a follow-up

Regards,
Lars
Mark HHP
Posts: 387
Joined: Mon May 06, 2013 6:59 am
Location: Cape Town, South Africa

Post by Mark HHP »

Anyone ever expand upon this? It looks pretty much like what I need. (A log of everything changed, added etc)
Mark
Running V5.7 (Build 1714) Linux Server. MySQL
Post Reply