update

In SOAP web services, the update operation is used to update an instance of a record.

Only the fields that have been populated in each submitted record are updated. If a field has NOT been populated, it is not updated and it retains its previous value. If a field is set to an empty string, the previous value of the field is replaced with an empty string.

SOAP Request

In the following example, a customer's companyName is updated. The internal ID for the customer must be provided in the request.

            <soap:Body>
<platformMsgs:update>
   <platformMsgs:record internalId="980" xsi:type="listRel:Customer">
      <listRel:companyName>Shutter Fly Corporation</listRel:companyName>
   </platformMsgs:record>
</platformMsgs:update>
</soap:Body> 

          

SOAP Response

The following example shows that the previous request completed successfully.

            <soapenv:Body>
<updateResponse xmlns="urn:messages_2025_1.platform.webservices.netsuite.com">
<writeResponse xmlns="urn:messages_2025_1.platform.webservices.netsuite.com">
   <ns1:status isSuccess="true" xmlns:ns1="urn:core_2025_1.platform.webservices.netsuite.com"/>
      <baseRef internalId="980" type="customer" xsi:type="ns2:RecordRef"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:ns2="urn:core_2025_1.platform.webservices.netsuite.com"/>
</writeResponse>
</updateResponse>
</soapenv:Body> 

          

REST Request

In REST web services, you can update a record instance using the PATCH HTTP method. The PATCH method expects a request body with the same fields that can be retrieved using the GET method. That is, the record's metadata schema is shared between reads and updates.

In the following example, the companyName of a specific customer record instance is updated. In this example, the company name of the record instance 980 is changed to Shutter Fly Corporation. Send the following request to perform the update.

            PATCH https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/980
BODY { "companyName": "Shutter Fly Corporation" } 

          

REST Response

The following is an excerpt from the response headers of a successful operation, with no body content returned (HTTP Code 204). The URL of the updated record is given in the Location header of the response.

            Date Fri, 04 Jan 2025 09:07:01 GMT
Location https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/980
Content-Type application/json 

          

Related Topics

General Notices