﻿<?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?)  » Navigate on Form causes dirty BO</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 05:29:30 GMT</lastBuildDate><ttl>20</ttl><item><title>Navigate on Form causes dirty BO</title><link>http://forum.strataframe.net/FindPost12058.aspx</link><description>I have created a SF Maintenance form that maintains a table.&amp;nbsp; The form does have combo boxes on it that use other BO's.&amp;nbsp; All that works fine.&amp;nbsp; I have 12 rows of data in the main table.&lt;/P&gt;&lt;P&gt;The issue is that when run the form, and try to navigate using the toolstrip navigator, it stops after navigating to the second record and no longer allows navigation through the rest of the record set (which via debugger, and Browse, all 12 rows DO exist in the BO).&amp;nbsp; When I then try to close the form, it has set the main BO to isDirty even though no editing has taken place bythe user (form).&lt;/P&gt;&lt;P&gt;The first 3 columns of the table comprise the PK and ALL columns on the BO are now set to "Return Alternate on Null" with a value.&amp;nbsp; 3 columns on the table allow nulls, and are null in the database table.&amp;nbsp; I was able to add&amp;nbsp;all 12 records using the SF form created.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I do have 1 column that does not allow null, that is programatically set, which is the "date added". And the only way I could get it to work was to set the "Return Alternate on Null" property in the BO Mapper.&lt;/P&gt;&lt;P&gt;I know this has something to do with the combination of the database table allowing nulls, and the BO setting of "Don't Allow Nulls", "Return Alternate on Null", "Return Alternate on Null / Set Alternate on Null".&amp;nbsp; It seems like I have yet to find the combination that works.&lt;/P&gt;&lt;P&gt;??????????????</description><pubDate>Fri, 19 Oct 2007 09:50:26 GMT</pubDate><dc:creator>Doug Birtell</dc:creator></item><item><title>RE: Navigate on Form causes dirty BO</title><link>http://forum.strataframe.net/FindPost12102.aspx</link><description>Great!&amp;nbsp; Glad you found the problem :)&amp;nbsp;</description><pubDate>Fri, 19 Oct 2007 09:50:26 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Navigate on Form causes dirty BO</title><link>http://forum.strataframe.net/FindPost12101.aspx</link><description>Brilliant!&lt;/P&gt;&lt;P&gt;Problem solved.&amp;nbsp; I knew it had to be something simple like that.&lt;/P&gt;&lt;P&gt;Thanks to all and have a wonderful weekend!</description><pubDate>Fri, 19 Oct 2007 09:48:03 GMT</pubDate><dc:creator>Doug Birtell</dc:creator></item><item><title>RE: Navigate on Form causes dirty BO</title><link>http://forum.strataframe.net/FindPost12100.aspx</link><description>More than likely this is not a Null issue.&amp;nbsp; Put a breakpoint in the IsDirtyChanged event of the BO that is becoming dirty.&amp;nbsp; Then look at the call stack to see where it became dirty.&amp;nbsp; More than likely there is something on the form that is setting the field which is making it become dirty.&amp;nbsp; For example, a combo may be getting requeried or set again which updates the bound values which could be causing the BO to become dirty.&amp;nbsp; This is where I would start.&amp;nbsp; More than likely this is because of something that is occuring within the form outside of the framework.</description><pubDate>Fri, 19 Oct 2007 09:38:33 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Navigate on Form causes dirty BO</title><link>http://forum.strataframe.net/FindPost12095.aspx</link><description>I understand what Peter has said, and that makes sense that the BO thinks it is dirty because of the difference in values between it and the database, depending on how you set the "Null option value" selected in the BO Mapper.&lt;/P&gt;&lt;P&gt;I now have &lt;U&gt;data in every single column of the table, and all rows now set to not allow nulls&lt;/U&gt;.&amp;nbsp; I still get the same dirty BO when I navigate.&amp;nbsp; &lt;/P&gt;&lt;P&gt;A. I have&amp;nbsp;set the BO to "Return Alternate on Null" on &lt;STRONG&gt;&lt;U&gt;all&lt;/U&gt;&lt;/STRONG&gt; columns and tried that as well.&amp;nbsp; Same result, can't navigate - causes dirty BO.&lt;/P&gt;&lt;P&gt;B. I have&amp;nbsp;set the BO to "Return Alternate on Null / Set Alternate on Null" on &lt;STRONG&gt;&lt;U&gt;all&lt;/U&gt;&lt;/STRONG&gt; columns and tried that as well.&amp;nbsp; Same result, can't navigate - causes dirty BO.&lt;/P&gt;&lt;P&gt;This is how I understand the "Null option value" to work.....&lt;/P&gt;&lt;P&gt;Return Alternate on Null - If the DB column is null, it returns the alternate value to the BO &lt;STRONG&gt;&lt;U&gt;AND&lt;/U&gt;&lt;/STRONG&gt; updates the DB Column with the alternate value if one is not supplied otherwise.&lt;/P&gt;&lt;P&gt;Return and Set Alternate on Null - If the DB column is null, it returns the alternate value to the BO, but does NOT update the DB column with the alternate. i.e. it leaves the DB column alone unless a value is provided otherwise.&lt;/P&gt;&lt;P&gt;Both of these seems backwards to me.&amp;nbsp; i.e. Return and Set should return alt value to BO and Set value in DB.&lt;/P&gt;&lt;P&gt;It also seems like the whole idea of the BO Mapper with the Null option value, is to not have to write code to get around null values.&amp;nbsp; What am I missing here?&lt;/P&gt;&lt;P&gt;???????????????????</description><pubDate>Fri, 19 Oct 2007 09:25:51 GMT</pubDate><dc:creator>Doug Birtell</dc:creator></item><item><title>RE: Navigate on Form causes dirty BO</title><link>http://forum.strataframe.net/FindPost12082.aspx</link><description>Peter has a very good point.&amp;nbsp; Try his suggestion and if it doesn't resolve your issue then we can look at something else.</description><pubDate>Fri, 19 Oct 2007 08:27:01 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Navigate on Form causes dirty BO</title><link>http://forum.strataframe.net/FindPost12077.aspx</link><description>G'day&lt;P&gt;[quote]T&lt;SPAN id=ctl02_ctlTopic_ctlPanelBar_ctlTopicsRepeater_ctl04_lblFullMessage&gt;he issue is that when run the form, and try to navigate using the toolstrip navigator, it stops after navigating to the second record and no longer allows navigation through the rest of the record set (which via debugger, and Browse, all 12 rows DO exist in the BO).&amp;nbsp; When I then try to close the form, it has set the main BO to isDirty even though no editing has taken place bythe user (form).&lt;/P&gt;&lt;P&gt;The first 3 columns of the table comprise the PK and ALL columns on the BO are now set to "Return Alternate on Null" with a value.&amp;nbsp; 3 columns on the table allow nulls, and are null in the database table.&lt;/SPAN&gt;[/quote]&lt;P&gt;I'm pretty certain the reason the Main BO is dirty is that the Nulls from the database are now the value you have set them to "Return Alternate on Null" with the Business Object Mapper (BOM), hence a change that needs to be saved.&lt;P&gt;We set all the value type fields to Nullable Generic in the BOM, and accessing the values of such fields are handled in code as follows&lt;P&gt;[codesnippet]If MyBO.MyNullableGenericValueType.HasValue Then&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyVar = MyBO.MyNullableGenericValueType.Value &lt;BR&gt;End If[/codesnippet]&lt;P&gt;string and timestamp fields we set to return alternate on null in the BOM with values "String.Empty" and "Nothing" respectively. We have generally tried to minimise nulls in the database, and so don't have string fields that can be null.&lt;P&gt;I hope this helps with part of your problem.&lt;P&gt;Peter</description><pubDate>Thu, 18 Oct 2007 19:13:23 GMT</pubDate><dc:creator>Peter Denton</dc:creator></item></channel></rss>