Audit Trail On Inventory Notes Tab.  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Audit Trail On Inventory Notes Tab.  Topic is solved

Postby Ernst » Fri Oct 27, 2017 2:56 pm

Somebody may find this useful.. If somebody tries to delete the Notes, it save a Note that XXXX changed Notes... Gotcha..:)

On an Inventory Plugin
Under Implements add this.

Private PropertiesChanges As String
Private PriorProperty As String

Under SetupBeforehandlers add this.

AddHandler inventoryForm.Inventory.SaveStart , AddressOf Inventory_SaveStart

Under the setup Sub add this.

Private Sub Inventory_PropertyChanged(sender As Object, e As System.ComponentModel.PropertyChangedEventArgs)
If PriorProperty <> e.PropertyName Then
PropertiesChanges = PropertiesChanges & " " & e.PropertyName
End If
PriorProperty = e.PropertyName
End Sub

And add this Sub to Load your Audit Note.

Private Sub Inventory_SaveStart(sender As Object, e As System.EventArgs)
' Write Note, so we can Track changes.
Dim inventory As JiwaInventory.Inventory = sender
inventory.Notes.Add(New JiwaApplication.Notes.Note With {.NoteText = "SaveDone Items Changed:" & PropertiesChanges , .NoteType = inventory.Notes.DefaultNoteType})
PropertiesChanges = ""
End Sub

Happy Coding...:)
User avatar
Ernst
Kohai
Kohai
 
Posts: 219
Joined: Tue Feb 19, 2008 3:43 pm
Topics Solved: 12

Re: Audit Trail On Inventory Notes Tab.

Postby Mike.Sheen » Sun Oct 29, 2017 4:30 pm

You could also create an abstract permission for the ability to delete notes, and only add that permission to user groups you want to allow delete of notes - then in a plugin throw an exception upon note delete based on that permission, which prevents the user from deleting it in the first place.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Audit Trail On Inventory Notes Tab.

Postby Ernst » Thu Nov 02, 2017 6:27 pm

Good idea.
User avatar
Ernst
Kohai
Kohai
 
Posts: 219
Joined: Tue Feb 19, 2008 3:43 pm
Topics Solved: 12


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 13 guests