record.attach(options)
Method Description |
Attaches a record to another record.
Note:
For the promise version of this method, see record.attach.promise(options). Note that promises are only supported in client scripts. |
Returns |
void |
Governance |
10 units |
Module |
|
Since |
2015.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
required |
The record to attach. |
2015.2 |
|
|
string |
required |
The type of record to attach. Set this value using the record.Type enum. To attach a file from the File Cabinet to a record, set type to |
2015.2 |
|
number | string |
required |
The internal ID of the record to attach. |
2015.2 |
|
required |
The record that the |
2015.2 |
|
|
string |
required |
The record type of the record to attach to. Set the value using the record.Type enum. To attach a file from the File Cabinet to a record, set type to |
2015.2 |
|
number | string |
required |
The internal ID of the record to attach to. |
2015.2 |
|
Object |
optional |
The name-value pairs containing attributes for the attachment. By default, this value is null. |
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 id = record.attach({
record: {
type: 'file',
id: '200'
},
to: {
type: 'customer',
id: '90'
}
});
...
// Add additional code
record.attach({
record: {
type: 'contact',
id: 2
},
to: {
type: 'customer',
id: 3
},
attributes: {
role: 3
}
});