Modules

filter

 

Objects/Functions

module (N/record)

SuiteScript 2.0

record.attach(options)

{record}.attach({record: {type: {string*},id: {number | string*}},to: {type: {string*},id: ${7:number | string*}},attributes: ${8:Object}})

N/record Module
record.attach()
Method Description: Attaches a record to another record. For the promise version of this method, see record.attach.promise(options). Note that promises are only supported in client scripts.
Returns: void
Supported Script Types: Client and server-side scripts For more information, see SuiteScript 2.0 Script Types.
Governance: 10 units
Module: N/record Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=record.attach(options)

Example:

// Code Example 1
// Add additional code.
//...
var id = record.attach({
record: {
type: 'file',
id: '200'
},
to: {
type: 'customer',
id: '90'
}
});
//...
// Add additional code.

// Code Example 2
record.attach({
record: {
type: 'contact',
id: 2},
to: {
type: 'customer',
id: 3},
attributes: {
role: 3}
});

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4267284169.html