How to Call https.patch in NetSuite to Update a Salesforce Record

You can work around this limitation by sending a POST request and including a query string parameter _HttpMethod to override the HTTP method.

For example, if you need to perform a PATCH requestyou can modify your request as follows by adding ?_HttpMethod=PATCH to the end of your url

POST /your/endpoint?_HttpMethod=PATCH

I found this solution in the Salesforce Developers Guide. Here’s a relevant excerpt:

If you use an HTTP library that doesn’t allow overriding or setting an arbitrary HTTP method name, you can send a POST request and provide an override to the HTTP method via the query string parameter _HttpMethod. In the PATCH example, you can replace the PostMethod line with one that doesn’t use override.

This approach allows you to use the PATCH HTTP method with N/https module in NetSuite.

Leave a comment

Your email address will not be published. Required fields are marked *