Force.com-Toolkit-for-NET icon indicating copy to clipboard operation
Force.com-Toolkit-for-NET copied to clipboard

Setting a date field to nothing doesn't get sent in the json

Open djlaney3 opened this issue 4 years ago • 3 comments

When using UpdateAsync, and passing an object with a datefield set to null or nothing, the json for that fields does not get sent up to salesforce. How do we set a datefield to not have a value?

djlaney3 avatar Apr 28 '20 11:04 djlaney3

Does this give you a '' is not a valid value for the type xsd:date error? It what I am getting when trying to do a BulkConstants.OperationType.Update update.

stephen-wond avatar Apr 28 '20 13:04 stephen-wond

No, when I set it to nothing (vb.net), the SDK does not send the value in the JSON payload. When you set it to a value, it gets included in the payload.

djlaney3 avatar Apr 28 '20 22:04 djlaney3

This still seems to be an issue, was originally discussed here: https://github.com/wadewegner/Force.com-Toolkit-for-NET/issues/197 and there was a pull request here: https://github.com/wadewegner/Force.com-Toolkit-for-NET/pull/268 but it doesn't look like all of the pull request was taken into the source so I don't believe there is yet a solution outside of running your own fork of the code...

jeffolmstead avatar May 22 '20 19:05 jeffolmstead