﻿<?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 » Issues  » About null values with ReturnAlternateOnNull  results in "'MustInherit' or override" error message</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 09:03:29 GMT</lastBuildDate><ttl>20</ttl><item><title>About null values with ReturnAlternateOnNull  results in "'MustInherit' or override" error message</title><link>http://forum.strataframe.net/FindPost1306.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;In my BusinessObjects there are two fields that initially will be null. The fields are CREATED (DATE) and CREATED_BY (Char). In the Business Object Mapper these have been set to "Return Alternate On Null". The CREATED has the NULL&amp;nbsp;replacement set to&amp;nbsp;System.DateTime.Today.&amp;nbsp;CREATED_BY&amp;nbsp;has the same value set to String.Empty.&lt;/P&gt;&lt;P&gt;When compiling the application the following error is returned: &lt;BR&gt;&lt;BR&gt;For the CREATED field the error message is&lt;/P&gt;&lt;P&gt;Error&amp;nbsp;1&amp;nbsp;Class 'Field_CREATED_Descriptor' must either be declared 'MustInherit' or override the following inherited 'MustOverride' member(s): &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.ComponentModel.PropertyDescriptor : Public MustOverride Sub SetValue(component As Object, value As Object).&amp;nbsp;File: BO_CompanyDetails.Designer.vb&lt;/P&gt;&lt;P&gt;and for the CREATED_BY the error is&lt;/P&gt;&lt;P&gt;Error&amp;nbsp;2&amp;nbsp;Class 'Field_CREATED_BY_Descriptor' must either be declared 'MustInherit' or override the following inherited 'MustOverride' member(s): &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.ComponentModel.PropertyDescriptor : Public MustOverride Sub SetValue(component As Object, value As Object).&amp;nbsp;FILE: BO_CompanyDetails.Designer.vb&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas how to fix this?&lt;/P&gt;&lt;P&gt;TIA,&lt;BR&gt;Kari&lt;/P&gt;&lt;P&gt;ps.&amp;nbsp;Is it possible to have the &amp;nbsp;CREATED -field to be null rather than the&amp;nbsp;&amp;nbsp;System.DateTime.Today (The dartabase would take care of setting the value in case it's null)</description><pubDate>Wed, 31 May 2006 13:58:56 GMT</pubDate><dc:creator>Kari Paukku</dc:creator></item><item><title>RE: About null values with ReturnAlternateOnNull  results in "'MustInherit' or override" error message</title><link>http://forum.strataframe.net/FindPost1308.aspx</link><description>No, Kari, that's actually a bug... the SetValue method still needs to be overridden, even if the property is specified as ReadOnly.&amp;nbsp; &lt;/P&gt;&lt;P&gt;[quote]ps.&amp;nbsp;Is it possible to have the &amp;nbsp;CREATED -field to be null rather than the&amp;nbsp;&amp;nbsp;System.DateTime.Today (The dartabase would take care of setting the value in case it's null)[/quote]&lt;/P&gt;&lt;P&gt;Yes, Kari, you can.&amp;nbsp; Basically, when you create a new record within the business object, the business object will initialize the fields within the new row so that there are no NULL values.&amp;nbsp; If you want all of the fields to be null, then you can set the AllowNullValues property on the business object to True, and the BO will not initialize the values (leaving the NULLs).&amp;nbsp; But, if you just want NULL values on those 2 fields, then your best bet is to do this:&lt;/P&gt;&lt;P&gt;Within the SetDefaultValues() event handler of the business object, put these 2 lines:&lt;/P&gt;&lt;P&gt;Me.CurrentRow.Item("Created") = DbNull.Value&lt;/P&gt;&lt;P&gt;Me.CurrentRow.Item("Created_By") = DbNull.Value&lt;/P&gt;&lt;P&gt;This will initialize those 2 fields with null values.&amp;nbsp; Your properties will still return the alternate values, but those null values will be saved back to the database.</description><pubDate>Wed, 31 May 2006 13:58:56 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: About null values with ReturnAlternateOnNull  results in "'MustInherit' or override" error message</title><link>http://forum.strataframe.net/FindPost1307.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I resolved(?) this. The conflict was caused by the fact that I had also checked the "Read Only" check box for the fields in questiion. Clearing that removed the error.&lt;/P&gt;&lt;P&gt;Sorry for the "red herring"&lt;/P&gt;&lt;P&gt;Kari</description><pubDate>Wed, 31 May 2006 13:40:49 GMT</pubDate><dc:creator>Kari Paukku</dc:creator></item></channel></rss>