After successfully following the steps detailed in the following articles related to SOAP Web Services Integration:
You are now ready to interact with records within NetSuite. One of the key operations available in SOAP Web Services is the initialize operation. This operation replicates the manual steps typically performed in the NetSuite UI, where values from related records are automatically carried over to new transactions. For example, you can use this functionality to prepopulate an invoice based on a sales order, saving time, and reducing errors in data entry.
To view the list of transaction types supported by the initialize operation, refer to the SuiteAnswer article: initialize / initializeList
Note: Ignore Read-Only Preference
To submit an initialized record without removing read-only fields populated during initialization, set the Ignore Read-Only header preference to TRUE.
SOAP Request
Below is a sample SOAP request for creating an invoice based on a sales order:
<soapenv:Body>
<initialize xsi:type='platformMsgs:InitializeRequest'>
<initializeRecord xsi:type='platformCore:InitializeRecord'>
<type xsi:type='xsd:string'>invoice</type>
<reference xsi:type='platformCore:InitializeRef' type='salesOrder' internalId='8029'/>
</initializeRecord>
</initialize>
</soapenv:Body>
Here's a breakdown of the key components of the SOAP body:
<initialize xsi:type="platformMsgs:InitializeRequest">
- Specifies that this operation is of type InitializeRequest, which belongs to the platformMsgs namespace.
<initializeRecord xsi:type="platformCore:InitializeRecord"><type xsi:type="xsd:string">invoice</type>
- Indicates the type of transaction to be initialized. In this case, type is set to "invoice".
<reference xsi:type="platformCore:InitializeRef" type="salesOrder" internalId="8029"/>
- The <reference> tag identifies the related record to pull data from.
- Here, we are referencing a salesOrder with an internalId of 8029.
The sample code described herein is provided on an "as is" basis, without warranty of any kind, to the fullest extent permitted by law. Oracle + NetSuite Inc. does not warrant or guarantee the individual success developers may have in implementing the sample code on their development platforms or in using their own Web server configurations.
Oracle + NetSuite Inc. does not warrant, guarantee or make any representations regarding the use, results of use, accuracy, timeliness or completeness of any data or information relating to the sample code. Oracle + NetSuite Inc. disclaims all warranties, express or implied, and in particular, disclaims all warranties of merchantability, fitness for a particular purpose, and warranties related to the code, or any service or software related thereto.
Oracle + NetSuite Inc. shall not be liable for any direct, indirect, or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code.
You can check different New to NetSuite Articles about different operations, See the following.
Stay tuned for upcoming articles where we explore SOAP Web Services under SuiteCloud Product Area. Stay updated by following the New to NetSuite> SuiteCloud category to receive notifications whenever new articles are published.