Setting a list of audited fields at design time


Author
Message
Andria Jensen
Andria Jensen
StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Those were properties that I implemented on the base business object which I created for myself.  So no, they are not part of the framework.
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
These are not framework properties, and technically we have not fully released auditing even though most if it is already within the framework.  There are two properties, however, that are on the BOs.  One called AuditDataChanges and the other is NeverAuditDataChanges.  The reason for the NeverAuditDataChanges is so that if auditing is turned on within RBS (Security) the BO would never audit anything. 

But the remaining components of auditing have not yet been released in regards to field selection, etc.

Chan
Chan
Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

Are Me.AuditUserChanges And Me.AuditedFields custom property? I couldn't find them even though I have installed 1.6.6 beta. If it is custom property, shall you please show sample code on how to control fields to be audited?



Thank you
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
I was posting the same time as you....yeah, that would make sense.  Glad you found it Smile
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
I don't know what your base BO looks like, but you will need to have at least this:

Imports System.Runtime.Serialization

Public Class MyBaseBO
    Inherits MicroFour.StrataFrame.Business.BusinessLayer

#Region " Constructors "

    <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
    Public Sub New()
        MyBase.New()
    End Sub

    <System.Diagnostics.DebuggerNonUserCodeAttribute()> _
    Public Sub New(ByVal Container As System.ComponentModel.IContainer)
        MyBase.New()

        '-- Add self to the specified container
        Container.Add(Me)
    End Sub

    Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
        MyBase.New(info, context)
    End Sub

#End Region

End Class

Double check your base BO to make sure that you have at least the constructors and are not calling anything that could cause a problem as design-time, and that you do not have a partial class with other properties, for example, that are getting in the way.  If you were to create this class above, and then inherit from it, you will not get the error you are describing.  I am not sure exactly how you are producing the error, but it will be along these lines.

Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
I found my problem. I had some code in the init component that checked the all field list
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
I just noticed this post and I am getting the same error, I may have had it for awhile as I haven't been in the design surface of a BO in quite some time.

I have a Base BO which inherits from Business layer

Then a Inherited BO this inherits from Base BO

All business object then inherit from Inherited Bo

Peter Denton
Peter Denton
StrataFrame Novice (109 reputation)StrataFrame Novice (109 reputation)StrataFrame Novice (109 reputation)StrataFrame Novice (109 reputation)StrataFrame Novice (109 reputation)StrataFrame Novice (109 reputation)StrataFrame Novice (109 reputation)StrataFrame Novice (109 reputation)StrataFrame Novice (109 reputation)
Group: Forum Members
Posts: 77, Visits: 787
G'day

I have a further thought, that may provide what you want. If you were to cearte another constructor in your base class something like

Public Sub New (ByVal FieldList() As String)
MyBase.New() ' to call the Strataframe constructor
If Me.AuditUserChanges And Me.AuditedFields.Count = 0 Then
 
For Each field As String In FieldList
   
Dim AuditField As New RequiredField()
    AuditField.FieldType =
Me.FieldDbTypes(field)
    AuditField.FieldName = field
    AuditedFields.Add(AuditField)
 
Next
End If
End Sub

Then in your end class your constructor(s) would look something like

Public Sub New (...)
MyBase.New(Me.AllFieldsList.ToArray) ' calling the base constructor
...

Hope this is more helpful

Peter

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
We have actually gone down a completely different route, and what you are trying to write is something that will be within the framework within the next several updates.  The problem is adding too much logic on the BO side versus the DAL or SQL side.

But in regards to your problem, this sounds like an issue within inheritance and maybe where you are placing your logic.  The AllFieldsList gets created in the partial class through the BO Mapper.  So that is where that error is coming from.  Past that I guess I don't know if there is anything else you were wanting to know or if I missed something.  Let me know.

Andria Jensen
Andria Jensen
StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Thanks for the clue, but you're right...it doesn't really help me fix it.  w00t

Trent/Ben, can either of you shed some light on the proper way to do what I'm trying to accomplish??  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