﻿<?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 » WebForms (How do I?)  » Custom fields don't show up in addbrokenrule list</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 00:18:57 GMT</lastBuildDate><ttl>20</ttl><item><title>Custom fields don't show up in addbrokenrule list</title><link>http://forum.strataframe.net/FindPost15881.aspx</link><description>Hi, &lt;br&gt;
&lt;br&gt;
I have some custom fields in a business object that are used to process a credit card payment.  The information isn't stored in database but does need to be validated, and then passed on to a processor. &lt;br&gt;
&lt;br&gt;
They are all required fields, and if skipped the error pointer shows up on the form.  But when I do custom validation under CheckRulesOnCurrentRow the error pointer won't show up on the form.  And I can't select the field from the Addbrokenrule list either. &lt;br&gt;
&lt;br&gt;
How can the form identify which field had the error so the error pointer shows up?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Marcel&lt;br&gt;
&lt;br&gt;
P.S. -- as a side thought, is it possible to use your business objects with custom fields only? (Nothing stored to database)     It seems to have problems with two-way binding, especially when the custom fields are validated, because it can't find the tablename. Just wondering since now I don't save data now, but later however might need to. Just tried to get out of setting up database right now.:blush:</description><pubDate>Tue, 29 Apr 2008 11:07:05 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: Custom fields don't show up in addbrokenrule list</title><link>http://forum.strataframe.net/FindPost15986.aspx</link><description>OK...I am not sure what you are doing wrong through the posts here, so I added a web application to the previous sample I supplied and it all works as it should.&amp;nbsp; So you might be able to determine where your issue is through this sample.&lt;/P&gt;&lt;P&gt;&lt;A href="http://forum.strataframe.net/FindPost15985.aspx"&gt;http://forum.strataframe.net/FindPost15985.aspx&lt;/A&gt;</description><pubDate>Tue, 29 Apr 2008 11:07:05 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Custom fields don't show up in addbrokenrule list</title><link>http://forum.strataframe.net/FindPost15976.aspx</link><description>PPS: Good Grief!&amp;nbsp; Also the _ZipCode and _ZipCode_Cust field&amp;nbsp;are really the same. Doesn't change the result though. :blush:</description><pubDate>Tue, 29 Apr 2008 00:16:14 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: Custom fields don't show up in addbrokenrule list</title><link>http://forum.strataframe.net/FindPost15900.aspx</link><description>Sorry the line didn't show up on the web page. Apparently it's parsed out, so I'll add the important bits.&lt;br&gt;
&lt;br&gt;
[codesnippet]...BindingField="ZipCode_cust" BusinessObjectName="CCBO" IgnoreManageUIReadOnlyState="True" MaxLength="10"&gt;...(and ofcourse its as sfweb:textbox)[/codesnippet]&lt;br&gt;
&lt;br&gt;</description><pubDate>Fri, 25 Apr 2008 13:47:11 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: Custom fields don't show up in addbrokenrule list</title><link>http://forum.strataframe.net/FindPost15898.aspx</link><description>OK, Thanks very much for the sample. Still got a problem though. &lt;br&gt;
&lt;br&gt;
This is what I allready had:&lt;br&gt;
&lt;br&gt;
[codesnippet] &lt;br&gt;
    Dim _ZipCode As String = "" &lt;br&gt;
    ''' &lt;br&gt;
    ''' Zip Code&lt;br&gt;
    ''' _ZipCode&lt;br&gt;
    ''' &lt;br&gt;
    &lt;Browsable(False), _&lt;br&gt;
     BusinessFieldDisplayInEditor(), _&lt;br&gt;
     Description("Zip Code"), _&lt;br&gt;
     DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)&gt; _&lt;br&gt;
    Public Property [ZipCode_cust]() As String&lt;br&gt;
        Get&lt;br&gt;
            Return _ZipCode&lt;br&gt;
        End Get&lt;br&gt;
        Set(ByVal value As String)&lt;br&gt;
            _ZipCode = value&lt;br&gt;
        End Set&lt;br&gt;
    End Property&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I allready had the call to validate:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
   Private Sub CCBO_CheckRulesOnCurrentRow(ByVal e As MicroFour.StrataFrame.Business.CheckRulesEventArgs)&lt;br&gt;
&lt;br&gt;
         '--Validate zip code&lt;br&gt;
        If Len(Me.ZipCode_cust.Trim) &gt; 0 Then&lt;br&gt;
            If Me.ZipCodeCheck(Me.ZipCode_cust.Trim) = False Then&lt;br&gt;
                Me.AddBrokenRule("zipcode_cust", "The Zip Code format in invalid.")&lt;br&gt;
            End If&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
     End Sub&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I added what you had in your business object:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
    Protected Overrides Function GetCustomBindablePropertyDescriptors() As MicroFour.StrataFrame.Business.FieldPropertyDescriptor()&lt;br&gt;
        Return New FieldPropertyDescriptor() {New ReflectionPropertyDescriptor("ZipCode_cust", GetType(AES_PPM_BOL.CCBO))}&lt;br&gt;
    End Function&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
The code for the field on the web page is as follows:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
&lt;SFWeb:TextBox ID="TextBox3" runat="server" Width="208px" BindingField="ZipCode_cust" BusinessObjectName="CCBO" IgnoreManageUIReadOnlyState="True" MaxLength="10"&gt;&lt;/SFWeb:TextBox&gt;&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Finally in the application base page I also had the following:&lt;br&gt;
[codesnippet]&lt;br&gt;
    Private Sub Page_PreRender1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender&lt;br&gt;
        Me.ErrorIcon = "images/brokenrule.gif"&lt;br&gt;
    End Sub&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Eventhough the error line shows up, which it had from the beginning, the Brokenrule.gif doesn't show up at end of textbox when I do custom validation.  It only shows up when the required field is empty (on same textbox).  Am I missing something else?</description><pubDate>Fri, 25 Apr 2008 13:39:35 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: Custom fields don't show up in addbrokenrule list</title><link>http://forum.strataframe.net/FindPost15886.aspx</link><description>I have created a sample that shows how to do this as it has come up a time or two in the past.&amp;nbsp; All you really need to do is call the AddBrokenRule method with the weak-typed call:&lt;/P&gt;&lt;P&gt;[codesnippet]Me.AddBrokenRule("MyCustomField","This field requires entry.")[/codesnippet]&lt;/P&gt;&lt;P&gt;But I created a sample that shows how to implement this and properly setup the BO as though it were created through the BO Mapper.&amp;nbsp; You can get that sample here: &lt;A href="http://forum.strataframe.net/FindPost15885.aspx"&gt;http://forum.strataframe.net/FindPost15885.aspx&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[quote]as a side thought, is it possible to use your business objects with custom fields only? (Nothing stored to database) It seems to have problems with two-way binding, especially when the custom fields are validated, because it can't find the tablename. Just wondering since now I don't save data now, but later however might need to. Just tried to get out of setting up database right now[/quote]&lt;/P&gt;&lt;P&gt;Absolutely.&amp;nbsp; There is no difference between a custom property that is created through the BO Mapper and stored data to the server versus a custom property that just stores to a variable.&amp;nbsp; The only time that you will have a two-way issue is if you do not setup the property descriptors or change the binding on the control to which it is being bound.&amp;nbsp; You will see in the above sample that I overwrote the GetCustomBindablePropertyDescriptors method and added the custom property as a ReflectionPropertyDescriptor there.&amp;nbsp; This ensures that the binding gets properly setup when binding.</description><pubDate>Fri, 25 Apr 2008 09:38:36 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>