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
You have to put the field in quotes, like this:
{
"Rating": null,
"CustomField__c" : null
}