ANS-1702 · WEB SERVICES & INTEGRATIONS
Streamlining NetSuite Object Duplication with Web Services
Discover the method for programmatically duplicating NetSuite records using web services.
Short answer
To copy a NetSuite object via web services, retrieve the source record, remove all system-generated IDs (internal, external, transaction) and non-creatable fields. Then, create the new record using a POST method for REST API or an 'add' operation for SOAP Web Services. SuiteScript users can leverage record.copy().
Scenario
Users often need to duplicate existing NetSuite records programmatically, such as transactions or custom records, while ensuring that system-generated data from the original record does not interfere with the creation of the new copy. This requires a specific approach when interacting with NetSuite via web services.
Solution
To efficiently copy a NetSuite object using web services, follow these steps:
Retrieve a reference to the NetSuite object intended for duplication.
Identify and remove all fields from the retrieved record that are system-generated or cannot be specified during a new record creation. Examples include 'Quantity Item received' and 'fulfillments'.
Ensure all system-assigned identifiers, such as internal IDs, external IDs, and transaction IDs, are removed from the record data.
To create the new, duplicated record, utilize the appropriate web service operation: a
POSTHTTP method for SuiteTalk REST API or anaddoperation for SuiteTalk SOAP Web Services.For SuiteScript implementations, the
record.copy()method provides a more direct and streamlined approach for duplicating records programmatically.
Expert NetSuite Support
Need help with this NetSuite issue?
Web Services & Integrations consulting and configuration support
