I have run some more tests now, and I can not understand reallt how the logic works. I get the following results for a new entity, that has not been saved yet:
//The following is copied from the watch window in InitClassEmpty (watching this.Fields["SalesDate"])
CurrentValue {1/1/1}
DataType {"System.DateTime"}
DbValue <undefined value>
IsNull false
IsNullable true
Name "SalesDate"
OriginalValue <undefined value>
//I perform a few null tests.
TestCurrentFieldValueForNull: True //Not accordning to the watch window
TestOriginalFieldValueForNull: False //Not accordning to the watch window
this.Fields["SalesDate"].IsNull: False //Correct, or...????
//I set the field value to null
SetNewFieldValue((int)MachineFieldIndex.SalesDate, null);
//The watch window now returns the following results
CurrentValue <undefined value>
DataType {"System.DateTime"}
DbValue <undefined value>
IsNull false
IsNullable true
Name "SalesDate"
OriginalValue {1/1/1}
TestCurrentFieldValueForNull: True //Correct
TestOriginalFieldValueForNull: False //Correct
this.Fields["SalesDate"].IsNull: False //Not correct, or...????