﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Setting a list of audited fields at design time</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 25 May 2026 09:11:07 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16856.aspx</link><description>Those were properties that I implemented on the base business object which I created for myself.&amp;nbsp; So no, they are not part of the framework.</description><pubDate>Thu, 05 Jun 2008 09:44:42 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16704.aspx</link><description>I have created a base business object which all of my BOs will inherit from.&amp;nbsp; This will handle among other thing, auditing user changes to data.&amp;nbsp; For each BO, I need to hold a list of AuditedFields so it know which fields it cares about changes on.&amp;nbsp; I have this working fine by using the same concept as the RequiredFields collection.&amp;nbsp; However, I would like for all fields to be checked by default instead of unchecked.&amp;nbsp; I have the following in the constructor of the base business object, which I thought would work:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;If&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;.AuditUserChanges &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;And&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;.AuditedFields.Count = 0 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;BR&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;For&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT size=2&gt; field &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.AllFieldsList.ToArray&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; AuditField &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; RequiredField()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AuditField.FieldType = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.FieldDbTypes(field)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AuditField.FieldName = field&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AuditedFields.Add(AuditField)&lt;BR&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Next&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;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.&amp;nbsp; The problem is that when I open any of the inherited BOs in the designer I get the following error message:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A class that inherits from MicroFour.StrataFrame.BusinessLayer must implement the AllFieldsList property.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Any idea what is going on here?&amp;nbsp; Am I just not using the AllFieldsList collection correctly here?&amp;nbsp; Is there a better way to accomplish what I'm trying to do?</description><pubDate>Thu, 05 Jun 2008 09:44:42 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16855.aspx</link><description>These are not framework properties, and technically we have not fully released auditing even though most if it is already within the framework.&amp;nbsp; There are two properties, however, that are on the BOs.&amp;nbsp; One called AuditDataChanges and the other is NeverAuditDataChanges.&amp;nbsp; The reason for the NeverAuditDataChanges is so that if auditing is turned on within RBS (Security) the BO would never audit anything.&amp;nbsp; &lt;/P&gt;&lt;P&gt;But the remaining components of auditing have not yet been released in regards to field selection, etc.</description><pubDate>Thu, 05 Jun 2008 08:56:51 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16850.aspx</link><description>Hi,&lt;br&gt;
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?&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Wed, 04 Jun 2008 20:19:08 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16802.aspx</link><description>I was posting the same time as you....yeah, that would make sense.&amp;nbsp; Glad you found it :)</description><pubDate>Tue, 03 Jun 2008 09:45:28 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16801.aspx</link><description>I don't know what your base BO looks like, but you will need to have at least this:&lt;P&gt;[codesnippet]Imports System.Runtime.Serialization&lt;/P&gt;&lt;P&gt;Public Class MyBaseBO&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inherits MicroFour.StrataFrame.Business.BusinessLayer&lt;/P&gt;&lt;P&gt;#Region " Constructors "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;System.Diagnostics.DebuggerNonUserCodeAttribute()&amp;gt; _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub New()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.New()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;System.Diagnostics.DebuggerNonUserCodeAttribute()&amp;gt; _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub New(ByVal Container As System.ComponentModel.IContainer)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.New()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Add self to the specified container&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Container.Add(Me)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.New(info, context)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;#End Region&lt;/P&gt;&lt;P&gt;End Class&lt;BR&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; If you were to create this class above, and then inherit from it, you will not get the error you are describing.&amp;nbsp; I am not sure exactly how you are producing the error, but it will be along these lines.</description><pubDate>Tue, 03 Jun 2008 09:44:39 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16800.aspx</link><description>I found my problem. I had some code in the init component that checked the all field list</description><pubDate>Tue, 03 Jun 2008 09:41:17 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16798.aspx</link><description>I just noticed this post&amp;nbsp;and I am getting the same error, I may have had&amp;nbsp;it for awhile as&amp;nbsp;I haven't been in the design surface of a BO in quite some time. &lt;/P&gt;&lt;P&gt;I have a Base&amp;nbsp;BO which inherits from&amp;nbsp;Business layer&lt;/P&gt;&lt;P&gt;Then a Inherited&amp;nbsp;BO this inherits from&amp;nbsp;Base BO&lt;/P&gt;&lt;P&gt;All business object then inherit from Inherited Bo</description><pubDate>Tue, 03 Jun 2008 09:32:40 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16784.aspx</link><description>G'day&lt;/P&gt;&lt;P&gt;I have a further thought, that may provide what you want. If you were to cearte another constructor in your base class something like&lt;/P&gt;&lt;P&gt;Public Sub New (ByVal FieldList() As String)&lt;BR&gt;MyBase.New() ' to call the Strataframe constructor&lt;BR&gt;If&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;.AuditUserChanges &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;And&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;.AuditedFields.Count = 0 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;BR&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;For&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Each&lt;/FONT&gt;&lt;FONT size=2&gt; field &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;In&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FieldList&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; AuditField &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; RequiredField()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AuditField.FieldType = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.FieldDbTypes(field)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AuditField.FieldName = field&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AuditedFields.Add(AuditField)&lt;BR&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Next&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;BR&gt;End Sub&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Then in your end&amp;nbsp;class your constructor(s) would look something like&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#1f5080&gt;Public Sub New (...)&lt;BR&gt;MyBase.New(&lt;FONT color=#0000ff&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.AllFieldsList.ToArray)&lt;/FONT&gt; ' calling the base constructor&lt;BR&gt;...&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Hope this is more helpful&lt;/P&gt;&lt;P&gt;Peter</description><pubDate>Mon, 02 Jun 2008 18:51:41 GMT</pubDate><dc:creator>Peter Denton</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16774.aspx</link><description>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.&amp;nbsp; The problem is adding too much logic on the BO side versus the DAL or SQL side.&lt;/P&gt;&lt;P&gt;But in regards to your problem, this sounds like an issue within inheritance and maybe where you are placing your logic.&amp;nbsp; The AllFieldsList gets created in the partial class through the BO Mapper.&amp;nbsp; So that is where that error is coming from.&amp;nbsp; Past that I guess I don't know if there is anything else you were wanting to know or if I missed something.&amp;nbsp; Let me know.</description><pubDate>Mon, 02 Jun 2008 10:57:17 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16771.aspx</link><description>Thanks for the clue, but you're right...it doesn't really help me fix it.&amp;nbsp; :w00t:&lt;/P&gt;&lt;P&gt;Trent/Ben, can either of you shed some light on the proper way to do what I'm trying to accomplish??&amp;nbsp; Thanks!</description><pubDate>Mon, 02 Jun 2008 10:20:51 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16715.aspx</link><description>Andria,&lt;/P&gt;&lt;P&gt;I think I know why this doesn't work in the constructor of your base BO, and that is because in the designer for your end BO will be &lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Public&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Overrides&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ReadOnly&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; AllFieldsList() ...&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;So your end BO will use this property correctly in code, but when the constructor for your base BO runs it will try to use its own &lt;FONT color=#000000&gt;AllFieldsList &lt;/FONT&gt;which will not have been instantiated.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;I don't have any suggestions to get around the problem, but I hope an understanding of the problem might help you find a solution. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Peter&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 29 May 2008 22:54:33 GMT</pubDate><dc:creator>Peter Denton</dc:creator></item><item><title>RE: Setting a list of audited fields at design time</title><link>http://forum.strataframe.net/FindPost16705.aspx</link><description>Just to also note, this approach DOES work in code.&amp;nbsp; It defaults so that all fields are audited, however I cannot get to the collection in the designer so that I can uncheck the fields which I don't want audited.</description><pubDate>Thu, 29 May 2008 17:33:08 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item></channel></rss>