You need to sign in to do that
Don't have an account?
Catie King
Can't set fieldsToNull for Contact via Rest API update/patch call
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.
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.
Invoice.fieldsToNull = new string[] { "Invoice__c", "Finish_Date__c" };"
Being the rest API, I don't have a Contact object to set Contact.fieldstoNull on. I have a resource path to specify, and a json map for fields to specify.
Unless the Invoice object they reference in that example is in fact the json object. In which case it is the same thing I suggested I did, which is include fieldsToNull = [field, field, field] in the json.
URL (resource path to change):
/sobjects/Contact/login_id__c/<login id>
JSON (fields to set):
{
"date_deleted__c": "2014-10-07",
"fieldsToNull": [
"provider__c",
"identity_fullname__c"
]
}
Alternatively I've tried:
URL:
/sobjects/Contact/login_id__c/<login id>?fieldsToNull=provider__c
JSON:
{
"date_deleted__c": "2014-10-07"
}
http://stackoverflow.com/questions/24549206/salesforce-com-rest-api-removing-object-fields-value