0

Is there a configuration to allow patching in SalesForce ?

I tried to patch the Account on Postman, no success. I also tried on Workbench, no success.

My Url (on workbench):

/services/data/v47.0/sobjects/Account/0011F00000YV8wsQAD

The Patch

{
 "AdCloud_PartnerID__c":"5400"
}

The Raw Response (form Workbench):

Raw Response
HTTP/1.1 500 Server Error
Date: Tue, 14 Jan 2020 09:21:20 GMT
Strict-Transport-Security: max-age=31536002; includeSubDomains
Public-Key-Pins-Report-Only: pin- 
sha256="blablabla"; pin- 
sha256="blablabla="; pin- 
sha256="blablabla"; max-age=86400; includeSubDomains; report- 
uri="https://a.forcesslreports.com/hpkp-report/00D1F0000009dh4m";
Expect-CT: max-age=86400, report-uri="https://a.forcesslreports.com/Expect- 
CT-report/00D1F0000009dh4m"
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: upgrade-insecure-requests 
X-Robots-Tag: none
Content-Length: 0

Why I can't Patch it ? The Error say sit is an internal error from lightning. I need to do such patch.

From Postman, PATCH + Identification with an access token :

https://myOrga--mySandbox.my.salesforce.com/services/data/v47.0/sobjects/Account/0011F00000YVnnwQAD

The headers Content-Type application/json

Body raw JSON:

{
"AdCloud_PartnerID__c":"5400"
}

I get the Error :

500 Server Error 

Code error :

curl --location --request PATCH 'https://orga-- 
sandbox.my.salesforce.com/services/data/v47.0/sobjects/Account 
/0011F00000YVnnwQAD' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 00D1F000000YNnMcdT' \
--data-raw '{ "AdCloud_PartnerID__c":"5406" }'

Always an internal error from SalesForce...

6
  • Can you copy the "Code" from POSTMAN and show us all the headers and the HTTP method being called? Commented Jan 15, 2020 at 14:59
  • @BryanAnderson I've edited the question with more information
    – Benoît S
    Commented Jan 15, 2020 at 15:35
  • can you actually click on the "Code" link next to "Cookies" under the Send button and paste what is in there in your question Commented Jan 15, 2020 at 15:46
  • @BryanAnderson Thanks I didn't know that, I just post the code
    – Benoît S
    Commented Jan 15, 2020 at 15:53
  • If it's not working from Workbench the problem may lie within Salesforce and not anything to do with the REST API. Are you using a privileged user that can see the AdCloud_PartnerID__c field to make this update? Try changing the field on the Account record page and see if there are any errors that aren't surfacing through the REST API.
    – nbrown
    Commented Jan 15, 2020 at 18:13

2 Answers 2

1

PATCH seems no longer supported. A work around is a POST method with a parameter :

_HttpMethod=PATCH

So It becomes :

https://orga--sandbox.my.salesforce.com/services/data/v47.0/sobjects/Account/{id}?_HttpMethod=PATCH

In the Body :

{
  "AdCloud_PartnerID__c":"5400"
}

Please, upvote is it works for you.

0

Here is a sample of a record update:

PATCH /services/data/v47.0/sobjects/Account/001XXXXXXXXXXXX HTTP/1.1
Host: myorg-dev-ed.my.salesforce.com
Authorization: Bearer 00DXXXXXXXX
Content-Type: application/json

{
    "BillingCity" : "San Francisco"
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .