﻿<?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?)  » Custom Fields on Business Object</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 12:20:56 GMT</lastBuildDate><ttl>20</ttl><item><title>Custom Fields on Business Object</title><link>http://forum.strataframe.net/FindPost12109.aspx</link><description>Is it possilbe to create a custom field in a business object to store temporary data for &lt;STRONG&gt;each row&lt;/STRONG&gt;&amp;nbsp;without creating a actual field in the database.&lt;/P&gt;&lt;P&gt;I tried creating a custom field in the business object and a Private variable to store and retrieve the value but it appears to only keep the last value.&lt;/P&gt;&lt;P&gt;I'm open to suggestions if this isn't the correct approach.&amp;nbsp; Basically I want to end up with a place to store / retrieve information in the business object for each row without having to create an extra field in the table.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Tim</description><pubDate>Fri, 02 Nov 2007 14:52:38 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Custom Fields on Business Object</title><link>http://forum.strataframe.net/FindPost12373.aspx</link><description>Gregg is probably on the right track.&lt;/P&gt;&lt;P&gt;I had quite a bit of trouble using the BBS and ended up making my own class for that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically what happens with a BBS is for every row in the business object that you are binding to,&amp;nbsp;a new instance of&amp;nbsp;the business object&amp;nbsp;is created and represent that row and its datatable is shared with the first main bo. &lt;/P&gt;&lt;P&gt;The problem is that if you have any properties , events etc set on the main bo the lose they're values in the newly created instance. hope that makes sense&lt;/P&gt;&lt;P&gt;However I would think because the datatable is shared you should be able to make it work somehow.</description><pubDate>Fri, 02 Nov 2007 14:52:38 GMT</pubDate><dc:creator>Paul Chase</dc:creator></item><item><title>RE: Custom Fields on Business Object</title><link>http://forum.strataframe.net/FindPost12371.aspx</link><description>I'm wondering if the problem is that you are using a grid.  I'm thinking out loud here...normal SF data binding is controlled by the BO but binding to a grid is through a BusinessBindingSource to the DataTable, so that might be the problem. &lt;br&gt;
&lt;br&gt;
If the extra data is temporary and you don't need to persist it, then the dictionary method would likely work better.  If you do need to persist it, then it looks like it could get complicated.  Sorry this isn't a more definitive answer :unsure:  I hope this helps you keep moving on the problem though :)&lt;br&gt;
&lt;br&gt;</description><pubDate>Fri, 02 Nov 2007 13:39:54 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Custom Fields on Business Object</title><link>http://forum.strataframe.net/FindPost12359.aspx</link><description>I'm trying to use these properties on grids so I added the custom bindable property descriptions but when I try to update I get an error indicating that the field isn't part of the business object.&lt;/P&gt;&lt;P&gt;Are these properties supposed to be bindable?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;TIm</description><pubDate>Thu, 01 Nov 2007 20:22:09 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Custom Fields on Business Object</title><link>http://forum.strataframe.net/FindPost12129.aspx</link><description>Another method that I use to store the temporary custom fields in the BOs data table. I usually add the custom colums in the select statement that fills the BO. Once the colums have been added I use the custom field properties to maintian them.&lt;FONT size=2&gt;&lt;P&gt;&amp;lt;Browsable(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;False&lt;/FONT&gt;&lt;FONT size=2&gt;), _&lt;BR&gt;BusinessFieldDisplayInEditor(), _|&lt;BR&gt;Description(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"Custom field"&lt;/FONT&gt;&lt;FONT size=2&gt;), _&lt;BR&gt;DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)&amp;gt; _&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/FONT&gt;&lt;FONT size=2&gt; cust_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;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Return&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;.CurrentRow.Item(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"CustomField"&lt;/FONT&gt;&lt;FONT size=2&gt;).ToString&lt;BR&gt;&amp;nbsp;&amp;nbsp; &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;Get&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Set&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; value &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;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentRow.Item(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"CustomField"&lt;/FONT&gt;&lt;FONT size=2&gt;) = value&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&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;Set&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&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;Property&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Since the&amp;nbsp;BO uses the AllFieldsNames property when saving or updating the object, the added fields are simply ignored.&lt;/P&gt;&lt;P&gt;-Larry&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Sat, 20 Oct 2007 22:53:16 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Custom Fields on Business Object</title><link>http://forum.strataframe.net/FindPost12124.aspx</link><description>Any time :D</description><pubDate>Fri, 19 Oct 2007 16:31:44 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Custom Fields on Business Object</title><link>http://forum.strataframe.net/FindPost12120.aspx</link><description>Greg, this is perfect. Thanks a lot! :)</description><pubDate>Fri, 19 Oct 2007 14:08:03 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Custom Fields on Business Object</title><link>http://forum.strataframe.net/FindPost12117.aspx</link><description>Tim,&lt;br&gt;
&lt;br&gt;
Instead using a private variable, use a private dictionary, with the key being the PK and the value being whatever you want to store...so....&lt;br&gt;
&lt;br&gt;
[codesnippet]' Holds data for custom temp property.&lt;br&gt;
' In this case, the PK is an integer and MyProp will hold a string.&lt;br&gt;
Private _myProp As Dictionary(Of Integer, String)&lt;br&gt;
&lt;br&gt;
' Of course, this would need the attributes to make a bindable property&lt;br&gt;
Public Property MyProp As String&lt;br&gt;
  Get &lt;br&gt;
    '  If dictionary hasn't been set yet, return a ZLS&lt;br&gt;
    If _myProp Is Nothing Then Return String.Empty&lt;br&gt;
&lt;br&gt;
    '  Where PKField is the strong typed property that accesses the PK of the BO&lt;br&gt;
    Return _myProp(Me.PKField)&lt;br&gt;
  End Get&lt;br&gt;
  Set(value As String)&lt;br&gt;
    ' check that the dictionary is initialized&lt;br&gt;
    If _myProp Is Nothing Then&lt;br&gt;
      _myProp = New Dictionary(Of Integer, String)&lt;br&gt;
    End If&lt;br&gt;
    _myProp.Add(Me.PKField,value)&lt;br&gt;
  End Set&lt;br&gt;
End Property&lt;br&gt;
[/codesnippet]</description><pubDate>Fri, 19 Oct 2007 12:16:44 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Custom Fields on Business Object</title><link>http://forum.strataframe.net/FindPost12113.aspx</link><description>I've used custom field properties many times as described in the help, but these are read-only. I need the ability update the custom field as well, just like a normal field. Perhaps I'm missing something here but I can't seem to achieve the desired results with the read-only property.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Tim</description><pubDate>Fri, 19 Oct 2007 11:02:30 GMT</pubDate><dc:creator>Tim Dol</dc:creator></item><item><title>RE: Custom Fields on Business Object</title><link>http://forum.strataframe.net/FindPost12111.aspx</link><description>Hi Tim,&lt;/P&gt;&lt;P&gt;Please take a look at the following topic in the SF help file "Custom Field Properties, Adding Custom Field Properties" it will show you how to do what you are looking for.&lt;/P&gt;&lt;P&gt;Good luck!</description><pubDate>Fri, 19 Oct 2007 10:48:30 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>