Setting a list of audited fields at design time


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have created a base business object which all of my BOs will inherit from.  This will handle among other thing, auditing user changes to data.  For each BO, I need to hold a list of AuditedFields so it know which fields it cares about changes on.  I have this working fine by using the same concept as the RequiredFields collection.  However, I would like for all fields to be checked by default instead of unchecked.  I have the following in the constructor of the base business object, which I thought would work:

If Me.AuditUserChanges And Me.AuditedFields.Count = 0 Then
 
For Each field As String In Me.AllFieldsList.ToArray
   
Dim AuditField As New RequiredField()
    AuditField.FieldType =
Me.FieldDbTypes(field)
    AuditField.FieldName = field
    AuditedFields.Add(AuditField)
 
Next
End If

So basically, I'm just saying if i'm auditing and haven't selected any fields to audit, go ahead and default to audit all of them by adding each field from the AllFieldsList to the AuditedFields collection.  The problem is that when I open any of the inherited BOs in the designer I get the following error message:

A class that inherits from MicroFour.StrataFrame.BusinessLayer must implement the AllFieldsList property.

Any idea what is going on here?  Am I just not using the AllFieldsList collection correctly here?  Is there a better way to accomplish what I'm trying to do?

Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
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.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Andria Jensen - 17 Years Ago
Andria Jensen - 17 Years Ago
Peter Denton - 17 Years Ago
Andria Jensen - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Peter Denton - 17 Years Ago
Paul Chase - 17 Years Ago
Paul Chase - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Chan - 17 Years Ago
                         These are not framework properties, and technically we have not fully...
Trent L. Taylor - 17 Years Ago
Andria Jensen - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search