Skip to main content
Kevin Glad ha preguntado en #Data Management
I have spent 2 days now trying to find the answer to this problem.  Non of the documented solutions seem to work.

 

I am using the PATCH function of a RestAPI using JSON to update a record.  I want some of the fields to be set back to null;

 

I have tried the following message bodies without success:

 

I tried

 

{

 

 somefield__c: null

 

}

 

I also tried

 

{

 

 fieldsToNull: ["somefield__c"]

 

}

 

and I tried

 

{

 

 somefield__c: "#.N/A"

 

}

 

It seems the fieldsToNull only works with SOAP APIs and APEX sobjects, "#.N/A" works with the bulk uploader, and somefield__c: null would never work.

 

Has anyone got this to work with Rest API's and JSON?

 

I am new to salesforce so maybe I am just doing it wrong.
5 respuestas
  1. 21 dic 2018, 4:50

    You have to put the field in quotes, like this:

    {

    "Rating": null,

    "CustomField__c" : null

    }

     

     
0/9000