﻿<?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?)  » BOM-generated bug with FieldChangingEvents and Nullable Fields</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 03 May 2026 01:25:42 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: BOM-generated bug with FieldChangingEvents and Nullable Fields</title><link>http://forum.strataframe.net/FindPost25769.aspx</link><description>Thank you!  I can wait for the next release.</description><pubDate>Thu, 04 Feb 2010 08:38:42 GMT</pubDate><dc:creator>Kirk M Sherhart</dc:creator></item><item><title>BOM-generated bug with FieldChangingEvents and Nullable Fields</title><link>http://forum.strataframe.net/FindPost23093.aspx</link><description>If a field has a Null Type of "Return and Set Alternate on Null..." and the Property Changing Events (either single or multiple) are generated, then the following code is generated.&lt;br&gt;
&lt;br&gt;
[codesnippet]public System.String FIELD1&lt;br&gt;
        {&lt;br&gt;
            get&lt;br&gt;
            {&lt;br&gt;
                object loValue;&lt;br&gt;
                loValue = this.CurrentRow["FIELD1"];&lt;br&gt;
                if (loValue == DBNull.Value)&lt;br&gt;
                {&lt;br&gt;
                    return "";&lt;br&gt;
                }&lt;br&gt;
                else&lt;br&gt;
                {&lt;br&gt;
                    return (System.String)loValue;&lt;br&gt;
                }&lt;br&gt;
            }&lt;br&gt;
            set&lt;br&gt;
            {&lt;br&gt;
                MyBOFieldChangingEventArgs e = new MyBOFieldChangingEventArgs(MyBOFieldNames.FIELD1, value);&lt;br&gt;
                this.OnFieldPropertyChanging(this, e);&lt;br&gt;
                if (value != "")     &lt;=== :w00t:*** Note: e is not used!!!! ***&lt;br&gt;
                {&lt;br&gt;
                    this.CurrentRow["FIELD1"] = value;&lt;br&gt;
                }&lt;br&gt;
                else&lt;br&gt;
                {&lt;br&gt;
                    this.CurrentRow["FIELD1"] = DBNull.Value;&lt;br&gt;
                }&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
The e.FieldValue is not used after returning from the event!!!!   The e.FieldValue should be cast/set to value (as it is if the field is not nullable.)</description><pubDate>Thu, 04 Feb 2010 08:38:42 GMT</pubDate><dc:creator>Kirk M Sherhart</dc:creator></item><item><title>RE: BOM-generated bug with FieldChangingEvents and Nullable Fields</title><link>http://forum.strataframe.net/FindPost25765.aspx</link><description>Fixed.&amp;nbsp; It will be in the next update.&amp;nbsp; If you want this assembly, let me know and I will send it to you.&amp;nbsp; We hope to post a minor update pretty quickly, so either way is good with me. :)</description><pubDate>Wed, 03 Feb 2010 20:40:02 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: BOM-generated bug with FieldChangingEvents and Nullable Fields</title><link>http://forum.strataframe.net/FindPost25762.aspx</link><description>Apparently this missed the list.&amp;nbsp; Changing it right now so it is sure to be in the next update.</description><pubDate>Wed, 03 Feb 2010 19:48:26 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: BOM-generated bug with FieldChangingEvents and Nullable Fields</title><link>http://forum.strataframe.net/FindPost25749.aspx</link><description>Just tried to see if the problem was fixed under 1.7.  No change.  Too bad.</description><pubDate>Wed, 03 Feb 2010 14:13:58 GMT</pubDate><dc:creator>Kirk M Sherhart</dc:creator></item><item><title>RE: BOM-generated bug with FieldChangingEvents and Nullable Fields</title><link>http://forum.strataframe.net/FindPost23109.aspx</link><description>What are you using for an alternate return value in the bo mapper?</description><pubDate>Thu, 14 May 2009 08:55:07 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: BOM-generated bug with FieldChangingEvents and Nullable Fields</title><link>http://forum.strataframe.net/FindPost23104.aspx</link><description>The result is the same if the null-replacement value is "" or String.Empty&lt;br&gt;
&lt;br&gt;
The problem is that e.FieldValue is not used after the return from OnFieldPropertyChanging (like it is for a non-nullable field).  If OnFieldPropertyChanging changes the value in e.FieldValue, it is not used to set the field value.</description><pubDate>Thu, 14 May 2009 08:30:14 GMT</pubDate><dc:creator>Kirk M Sherhart</dc:creator></item><item><title>RE: BOM-generated bug with FieldChangingEvents and Nullable Fields</title><link>http://forum.strataframe.net/FindPost23102.aspx</link><description>Do you get a different result if you return and test for string.empty instead of "" ?</description><pubDate>Thu, 14 May 2009 08:16:51 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item></channel></rss>