﻿<?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</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 03:12:19 GMT</lastBuildDate><ttl>20</ttl><item><title>Custom Fields</title><link>http://forum.strataframe.net/FindPost27561.aspx</link><description>The following code works and in the current data table I get the column called contestantname.&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
        Dim sqlbuilder As New StringBuilder(255)&lt;br&gt;
        With sqlbuilder&lt;br&gt;
            .AppendLine("SELECT bbpoints.contpk, bbpoints.rodeoid, ")&lt;br&gt;
            .AppendLine("bbpoints.eventcd, bbpoints.bbpk, bbpoints.go, ")&lt;br&gt;
            .AppendLine("bbpoints.perf, bbpoints.positioninperf, bbpoints.contestantnumber, ")&lt;br&gt;
            .AppendLine("bbpoints.section, bbpoints.rideleft, bbpoints.stockleft, ")&lt;br&gt;
            .AppendLine("bbpoints.rideright, bbpoints.stockright,  bbpoints.totalscore, ")&lt;br&gt;
            .AppendLine("bbpoints.reride1, bbpoints.reride2, bbpoints.stockbrand, bbpoints.stockname, ")&lt;br&gt;
            '.AppendLine("bbpoints.turnout, bbpoints.outofrodeo, contestants.membershipcd, ")&lt;br&gt;
            '.AppendLine("contestants.membershipnumber, contestants.contestantname ")&lt;br&gt;
            .AppendLine("contestants.contestantname ")&lt;br&gt;
            .AppendLine("FROM bbpoints INNER JOIN contestants ")&lt;br&gt;
            .AppendLine("ON bbpoints.contpk = contestants.contpk WHERE (Perf = 1) ")&lt;br&gt;
            .AppendLine("ORDER  BY perf, section, PositioninPerf ")&lt;br&gt;
        End With&lt;br&gt;
&lt;br&gt;
        Using cmd As New SqlCommand&lt;br&gt;
            cmd.CommandText = sqlbuilder.ToString()&lt;br&gt;
            Me.FillDataTable(cmd)&lt;br&gt;
        End Using&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
But when I try adding the following code to my bbpointsbo I get the error that follows.&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
    Protected Overrides Function GetCustomBindablePropertyDescriptors() As MicroFour.StrataFrame.Business.FieldPropertyDescriptor()&lt;br&gt;
        Return New MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _&lt;br&gt;
            New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor( _&lt;br&gt;
                "cowboy_Name", GetType(ContestantsRodeoBO))}&lt;br&gt;
&lt;br&gt;
    End Function&lt;br&gt;
    ''' &lt;summary&gt;&lt;br&gt;
    ''' The collection of required fields for the business object.&lt;br&gt;
    ''' &lt;/summary&gt;&lt;br&gt;
&lt;br&gt;
    &lt;Browsable(False), _&lt;br&gt;
    BusinessFieldDisplayInEditorAttribute(), _&lt;br&gt;
    Description("Cowboy Name"), _&lt;br&gt;
    DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)&gt; _&lt;br&gt;
    Public ReadOnly Property cowboy_Name() As String&lt;br&gt;
        Get&lt;br&gt;
            'Return MyBase.RequiredFields&lt;br&gt;
            If Me.CurrentDataTable.Columns.Contains("contestantname") Then&lt;br&gt;
                If Not TypeOf (Me.CurrentRow.Item("contestantname")) Is DBNull Then&lt;br&gt;
                    Return CStr(Me.CurrentRow.Item("contestantname"))&lt;br&gt;
                Else&lt;br&gt;
                    Return ""&lt;br&gt;
                End If&lt;br&gt;
            Else&lt;br&gt;
                Return ""&lt;br&gt;
            End If&lt;br&gt;
        End Get&lt;br&gt;
    End Property&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
There is a     Browsable(False), _ in the above code but does not seem to appear when I preview. I think it has to do with the '&lt;' in front.&lt;br&gt;
&lt;br&gt;
Error:&lt;br&gt;
&lt;br&gt;
System.NullReferenceException was unhandled by user code&lt;br&gt;
  Message=Object reference not set to an instance of an object.&lt;br&gt;
  Source=MicroFour StrataFrame Business&lt;br&gt;
  StackTrace:&lt;br&gt;
       at MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor..ctor(String PropertyName, Type PropertyOwner)&lt;br&gt;
       at SFCustomField.BBPointsRodeoBO.GetCustomBindablePropertyDescriptors() in C:\VSProjectsSamples2010\SFCustomField\SFCustomField\BBPointsRodeoBO.vb:line 113&lt;br&gt;
       at MicroFour.StrataFrame.Business.BusinessLayer.InternalGetAdditionalPropertyDescriptors()&lt;br&gt;
       at MicroFour.StrataFrame.Business.BusinessLayer..ctor()&lt;br&gt;
  InnerException: &lt;br&gt;
&lt;br&gt;
I'm not sure what to do. I was trying to follow what Edhy and Larry had done in a previous post. But of course I am missing something. Any help would be appreciated. Thanks in advance.&lt;br&gt;</description><pubDate>Tue, 29 Jun 2010 10:21:12 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Custom Fields</title><link>http://forum.strataframe.net/FindPost27579.aspx</link><description>No problem :)</description><pubDate>Tue, 29 Jun 2010 10:21:12 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Custom Fields</title><link>http://forum.strataframe.net/FindPost27578.aspx</link><description>Perfect. Thank you so much.</description><pubDate>Tue, 29 Jun 2010 09:07:10 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Custom Fields</title><link>http://forum.strataframe.net/FindPost27563.aspx</link><description>Hi Terry,&lt;br&gt;
&lt;br&gt;
The following code is wrong:&lt;br&gt;
&lt;br&gt;
[codesnippet]Protected Overrides Function GetCustomBindablePropertyDescriptors() As MicroFour.StrataFrame.Business.FieldPropertyDescriptor()&lt;br&gt;
Return New MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _&lt;br&gt;
New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor( _&lt;br&gt;
"cowboy_Name", GetType([b][u]ContestantsRodeoBO[/u][/b]))}&lt;br&gt;
End Function&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
The GetType should reference the current BO in which the Custom Field Property is being created, so it should be:&lt;br&gt;
&lt;br&gt;
[codesnippet]Protected Overrides Function GetCustomBindablePropertyDescriptors() As MicroFour.StrataFrame.Business.FieldPropertyDescriptor()&lt;br&gt;
Return New MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _&lt;br&gt;
New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor( _&lt;br&gt;
"cowboy_Name", GetType([b][u]bbpointsbo[/u][/b]))}&lt;br&gt;
End Function&lt;br&gt;
[/codesnippet]</description><pubDate>Mon, 28 Jun 2010 10:57:28 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>