• Catie King
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
I am using the REST API PATCH call to update a Contact like so:

URL: salesforce/data/<version>/sobjects/Contact/<externalidentifier>/<value>
JSON: map of fields to values

In addition to settings some values, I'd like to set others to null. I tried to pass fieldsToNull = [string, string, string] in the JSON.

However this results in a response saying:
"No such column 'fieldsToNull' on sobject of type Contact."

I also tried appending ?fieldsToNull=<field> to the request URL, which than returned successfully, but had no affect in respect to settings the field to null.

All documentation I can find providing examples with fieldsToNull are for soap/wsdl and not rest.
I am using the REST API PATCH call to update a Contact like so:

URL: salesforce/data/<version>/sobjects/Contact/<externalidentifier>/<value>
JSON: map of fields to values

In addition to settings some values, I'd like to set others to null. I tried to pass fieldsToNull = [string, string, string] in the JSON.

However this results in a response saying:
"No such column 'fieldsToNull' on sobject of type Contact."

I also tried appending ?fieldsToNull=<field> to the request URL, which than returned successfully, but had no affect in respect to settings the field to null.

All documentation I can find providing examples with fieldsToNull are for soap/wsdl and not rest.
I am using the REST API PATCH call to update a Contact like so:

URL: salesforce/data/<version>/sobjects/Contact/<externalidentifier>/<value>
JSON: map of fields to values

In addition to settings some values, I'd like to set others to null. I tried to pass fieldsToNull = [string, string, string] in the JSON.

However this results in a response saying:
"No such column 'fieldsToNull' on sobject of type Contact."

I also tried appending ?fieldsToNull=<field> to the request URL, which than returned successfully, but had no affect in respect to settings the field to null.

All documentation I can find providing examples with fieldsToNull are for soap/wsdl and not rest.

I have a .NET service I'm building to give me access to the data in Salesforce. I'm trying to get my update method(s) to work. Specifically, I need to know how to clear the value of a field in Salesforce. I presumed that since we're using JSON to pass the data back and forth that I can just set the field to null in the JSON string and Salesforce will clear the current value. That appears to not be the case, or I'm just plain dumb. For example if I post {"Invoice__c":"blah blah blah"} it works fine. But if I post {"Invoice__c":null,"Finish_Date__c":null,"Scheduled_Date_Time__c":"\/Date(1333526400000)\/","Walk_Date_Time__c":null} nothing happens. I don't even get an error message back. It simply doesn't work.

 

Am I doing something wrong (I obviously must be doing something wrong)? How do I correct this?

 

Thanks in advance for any help!