Which events should I use for auditing?


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You will want to use the Navigating event of the BO.  This event is fired through the BusinessBindingSource when using grids.
StarkMike
StarkMike
Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)
Group: Forum Members
Posts: 436, Visits: 944
Whoops! spoke too soon. I'm using a grid so I'd like to update the Modified fields when they change a row. So if they move to another row if they made any changes to that row I'd need to update those fields before they moved.

So I thought I would use the CheckRulesOnCurrentRow method in the BO.

So... my next questions are...

   Is there a dirty property for each record i could check to determine whether I need to update these fields?

   Am I correct in my approach here?


StarkMike
StarkMike
Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)
Group: Forum Members
Posts: 436, Visits: 944
That'll work. I'll test the editing state on the save. ;-)
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
It just depends on what you are trying to accomplish and what type of events you are auditing.  You are correct on the Add...this is what I would do.  As for the Edit, I would do this in the BeforeSave or AfterSave event and test on the EditingState of the BO to know if this is a new or existing record.
StarkMike
StarkMike
Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)Advanced StrataFrame User (532 reputation)
Group: Forum Members
Posts: 436, Visits: 944
Which BO events should I place my auditing code into?



I'm using the AfterAddNew event to place my created by audit info in the proper fields. I believe this is the right event for new records, but I'd like confirmation. ;-)



Private Sub BluePrintsBO1_AfterAddNew(ByVal e As System.EventArgs) Handles BluePrintsBO1.AfterAddNew

Me.BluePrintsBO1.Created = Now

Me.BluePrintsBO1.CreatedBy = SystemInformation.UserName

End Sub



Which event should I use when a record is modified?



Thanks



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search