﻿<?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?)  » How can I allow null values to be saved?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 09 Sep 2026 05:25:27 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How can I allow null values to be saved?</title><link>http://forum.strataframe.net/FindPost8448.aspx</link><description>Hi Guys,&lt;/P&gt;&lt;P&gt;Thanks for that - in retrospect I can't believe I didn't try Return and Set.&lt;/P&gt;&lt;P&gt;Cheers, Peter</description><pubDate>Mon, 23 Apr 2007 20:57:39 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>How can I allow null values to be saved?</title><link>http://forum.strataframe.net/FindPost8394.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I have string field that is nullable in the database. In my BO I have AllowNullValuesOnNewRow set to True. In the BO Custom Field Properties I have Return Alternate on Null with the value being String.Empty. When a new row is created I don't set a default value for this field.&lt;/P&gt;&lt;P&gt;Ok - now here's the problem. When I create a new row and don't touch that field a Null is saved to the database (good). However, if I put something in that field and then blank it out then "" (empty string) is saved to the database (bad).&lt;/P&gt;&lt;P&gt;If I have an existing record with a value in the field and I blank it out it is also saved as an empty string when, in fact, I really want it saved as a Null.&lt;/P&gt;&lt;P&gt;Try as I may I just can't find the magic settings to achieve nulls. How do I go about saving null values instead of empty strings.&lt;/P&gt;&lt;P&gt;Cheers, Peter</description><pubDate>Mon, 23 Apr 2007 20:57:39 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: How can I allow null values to be saved?</title><link>http://forum.strataframe.net/FindPost8420.aspx</link><description>Yep, Jerome is correct.&amp;nbsp; If you use the Return Alternate on NULL / Set NULL on Alternate, then setting the property to String.Empty will result in a DBNull.Value being put back into the DataTable by the property.&amp;nbsp; It's new functionality added by the latest 1.6 release, so if you don't have that option within the BOMapper, I would recommend downloading the latest SF version.&amp;nbsp; &lt;/P&gt;&lt;P&gt;The Set NULL on Alternate also works for reference types (INTs, FLOATs, etc.).</description><pubDate>Mon, 23 Apr 2007 09:14:13 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: How can I allow null values to be saved?</title><link>http://forum.strataframe.net/FindPost8413.aspx</link><description>In your post you said that you set "Return Alternate on Null".  You need to set your property to "Return Alternate on Null / Set Null on Alternate"&lt;br&gt;
&lt;br&gt;
Hope that helps&lt;br&gt;
&lt;br&gt;
Jerome</description><pubDate>Mon, 23 Apr 2007 08:43:45 GMT</pubDate><dc:creator>Jerome Barnett</dc:creator></item><item><title>RE: How can I allow null values to be saved?</title><link>http://forum.strataframe.net/FindPost8395.aspx</link><description>ps&lt;/P&gt;&lt;P&gt;While my question is specific to string fields I also have date fields that I needs to be able to save as nulls. I pretty sure all our numeric fields default to zero.&lt;/P&gt;&lt;P&gt;Cheers, Peter</description><pubDate>Sat, 21 Apr 2007 02:10:19 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item></channel></rss>