Setting an existing Date attribute to null

Nov 8, 2013 at 12:29 PM
I've been trying to get the client to set the value of a date attribute to dbnull.value, "", or 'nothing' without success. I have a custom resource (iRecord) that has a bunch of attributes, including iRecord.endDate of type datetime. The business logic I'm working with requires that an end date can be removed in some circumstances.

When I attempt to set the date attribute to null using:
iRecord("endDate") = New RmAttributeValueSingle(nothing)
or set to an empty string, or dbnull, the client throws an error: {"The request message contains errors that prevent processing the request."}

The client allows me to set non-date attributes to nothing, so my question is; does the FIM Web Service disallow setting a date attribute to null, or is this something that the client does that can be overridden?

I notice Paul Williams on his blog says that the FIM PowerShell commandlets don't support nulling a datetime attribute, and suggests;
Looks like this is a limitation in the cmdlet – it doesn’t correctly identify an empty string and handle that specific scenario. Work around is to set the value to [DateTime]::MaxValue or [DateTime]::MinValue, depending on the purpose of the attribute. Or use an alternative WCF client of course. Sorry…
Dec 2, 2013 at 6:54 PM
Rather than trying to null a non-nullable object, just remove the attribute from the attribute collection:

iRecord.Remove(New RmAttributeName("endDate"))