function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HenryHenry 

set .net date field to null

Is there a way to set a .net date field to null when it previously had a value.
SuperfellSuperfell
If you want to set it to null on the server side, use the fieldsToNull array on sobject. If you want to set it to null locally, you can't, the DateTime type in .NET is a value type and therefore can't be null.
HenryHenry

Thanks Simon here's some more detail for date fields.

If Not IsDBNull(dr("Inactive_Date")) Then

'Update the field

Else

Redim preserve sforce_sObject.fieldsToNull(ubound(.fieldsToNull) + 1)

.fieldsToNull(ubound(.fieldsToNull)) = "Inactive_Date__c"

End If