StrataFrame Forum

1/1/1800 Appearing As Default When Dates are NULL

http://forum.strataframe.net/Topic5569.aspx

By choyt - 1/4/2007

Hi Folks

I am real confident I'm doing something wrong in my setup here but don't know how to fix this.

When I don't assign a value to a BO date field, they are being assigned a date of 1/1/1800 somehow (see below image and where the breakpoint currently is in relation to the value being displayed)

I have setup my BO to return 1/1/1980 on NULL but that is not coming through.

Any idea what I am doing wrong?

By StrataFrame Team - 1/4/2007

The business objects have a property called AllowNullValuesOnNewRow that when False (the default), tells the business object to initialize all values on a new row to avoid any NULL values.  Strings are initialized to an empty string, numbers are initialized to 0, and dates are initialized to #01/01/1800#.  The code in the SetDefaultValues() method gets executed right after the row is initialized.  So, if you want to set only the one date time field to NULL so that your 01/01/1980 shows through, you can do this within the SetDefaultValues() method:

Me.CurrentRow("DRAFT_REVIEW_DATE") = DBNull.Value

If you want all of the fields to have NULL values, then you can set the AllowNullValuesOnNewRow property to False, but that might be a little more than you want Smile

By choyt - 1/4/2007

Now it all comes clear! Thanks Ben
By StrataFrame Team - 1/4/2007

Smile