record.copy(options)
Method Description |
Creates a new record by copying an existing record in NetSuite.
Note:
For the promise version of this method, see record.copy.promise(options). Note that promises are only supported in client scripts. |
Returns |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
Transaction records: 10 units Custom records: 2 units All other records: 5 units |
Module |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
The record type. Use the following guidelines:
|
2015.2 |
|
number |
required |
The internal ID of the existing record instance in NetSuite. |
2015.2 |
|
boolean |
optional |
Determines whether the new record is created in dynamic mode.
By default, this value is
Note:
For additional information about standard and dynamic mode, see record.Record and SuiteScript 2.x Standard and Dynamic Modes. |
2015.2 |
|
Object |
optional |
Name-value pairs containing default values of fields in the new record. By default, this value is null. For a list of available record default values, see N/record Default Values in the NetSuite Help Center. |
2015.2 |
Errors
Error Code |
Thrown If |
---|---|
|
A required argument is missing or undefined. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/record Module Script Samples.
// Add additional code
...
var objRecord = record.copy({
type: record.Type.SALES_ORDER,
id: 157,
isDynamic: true,
defaultValues: {
entity: 107
}
});
...
// Add additional code