initialize / initializeList

You can use the initialize operation in SOAP web services to emulate the UI workflow by prepopulating fields on transaction line items with values from a related record. Your SOAP web services application can then modify only the values it needs to before submitting the record.

SOAP Request

The following example shows the usage of the initialize operation.

            <soapenv:Body>
<platformMsgs:initialize xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:platformCoreTyp="urn:types.core_2025_1.platform.webservices.netsuite.com" xmlns:platformCore="urn:core_2025_1.platform.webservices.netsuite.com" xmlns:platformMsgs="urn:messages_2025_1.platform.webservices.netsuite.com">
   <platformMsgs:initializeRecord>
      <platformCore:type>invoice</platformCore:type>
      <platformCore:reference internalId="1513" type="salesOrder">
         <platformCore:name>1511</platformCore:name>
      </platformCore:reference>
   </platformMsgs:initializeRecord>
</platformMsgs:initialize>
</soapenv:Body> 

          

The following example shows the usage of the initializeList operation.

            <initializeList xmlns="urn:messages_2025_1.platform.webservices.netsuite.com">
  <initializeRecord>
    <ns1:type
       xmlns:ns1="urn:core_2025_1.platform.webservices.netsuite.com">customerPayment
    </ns1:type>
    <ns2:reference internalId="176" type="customer"
         xmlns:ns2="urn:core_2025_1.platform.webservices.netsuite.com"/>
  </initializeRecord>
  <initializeRecord>
    <ns3:type xmlns:ns3="urn:core_2025_1.platform.webservices.netsuite.com">
         invoice</ns3:type>
        <ns4:reference internalId="176" type="customer"
             xmlns:ns4="urn:core_2025_1.platform.webservices.netsuite.com"/>
   </initializeRecord>
</initializeList> 

          

REST Request

In REST web services, you can transform a record from one type into an another, using data from an existing record. This is the equivalent of the initialize SOAP operation. For example, you can create an invoice record from an existing sales order record, using data from the sales order.

In REST web services, you use the POST method to send a record transformation request. The record transformation is executed in a single request. In the request URL, the following details must be specified:

  • The record type you that you want to transform.

  • The ID of the record that you want to transform.

  • The transformation action. The transformation action must be formatted in the following way in the URL: !transform.

  • The record type you that you want transform into.

In the following example, a sales order record is transformed into an invoice. If the transformation is performed successfully, an HTTP 204 – No Content response is returned.

            POST http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/3/!transform/invoice 

          

In the request body, you can also specify data for additional fields of the record, as shown in the following example.

            {
   "memo": "REST, end date and bills date added",
   "enddate": "2020-01-14",
   "billdate": "2020-01-14",
   "item": {
      "items": [
         {
            "item": { "id": "3456" },
            "amount": 1
         }
      ]
   }
} 

          

Related Topics

General Notices