function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hemant Sharma 46Hemant Sharma 46 

PATCH Method in apex

Hi,

As per this document - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_httprequest.htm

I can see that I should be able to use the "PATCH" in request. When I wrote the code, its working good in Sandbox but not in Production.

In Production, I can see the below error:
:Invalid HTTP method: PATCH

Could any one help why I am getting this error in production only?
VinayVinay (Salesforce Developers) 
Hi Hemant,

 PATCH method in the HttpRequest class is supported in winter'21 org.  Since your sandbox is winter'21 its working and your production might in summer'20 and scheduled to be in winter'21 in coming days.

Kindly review below link which has details.

https://releasenotes.docs.salesforce.com/en-us/winter21/release-notes/rn_apex_callouts_patch.htm

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
Hemant Sharma 46Hemant Sharma 46
Hi Vinay,

Thank You for the link.

When can I see my production get updated?

Thank you
VinayVinay (Salesforce Developers) 
You can check using the trust link below.

https://status.salesforce.com/current

Eg.  If your production in on NA130 instance, you can search na130 in search box and click on the maintenance tab and you can see the date of 'Winter '21 Major Release'.

User-added image

Hope this helps!

Thanks,
Thomas MichaelThomas Michael
Thanks www.mcdvoice.com (https://www.mcdvoice.us/)