﻿<?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 / Business Objects and Data Access (How do I?)  / Allow null value in business object / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>forum@strataframe.net</webMaster><lastBuildDate>Fri, 21 Nov 2008 15:42:05 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Allow null value in business object</title><link>http://forum.strataframe.net/Topic1829-6-1.aspx</link><description>When a new record it added, the business object automatically initializes the values within the new row to remove any DBNull.Value values.  To prevent this, and allow all of the fields within the new row to be NULL, set the AllowNullValuesOnNewRow property on the business object to True.&lt;/P&gt;&lt;P&gt;If you only want a few fields to have NULL values, then in the SetDefaultValues event handler, add this code:&lt;/P&gt;&lt;P&gt;Me.CurrentRow("fieldname") = DBNull.Value&lt;/P&gt;&lt;P&gt;Add that for each field you want to initialize as a null value, and you'll be good to go.</description><pubDate>Thu, 13 Jul 2006 08:43:04 GMT</pubDate><dc:creator>Ben Chase</dc:creator></item><item><title>Allow null value in business object</title><link>http://forum.strataframe.net/Topic1829-6-1.aspx</link><description>Some of the fields in my table allow null value. Especially for datetime and decimal field. I want the default value of the controls, which mapped to these fields is null string ("") during initialization of add new record screen. How can I customize the fields in business object mapper so that the default value can be null string?</description><pubDate>Thu, 13 Jul 2006 06:09:51 GMT</pubDate><dc:creator>Wang Tong Yin</dc:creator></item></channel></rss>