Modules

filter

 

Objects/Functions

module (N/record)

SuiteScript 2.0

record.detach.promise(options)

{record}.detach.promise({record: {type: {string*},id: {number | string*}},from: {type: {string*},id: ${7:number | string*}},attributes: ${8:Object}}).then(function(response){// DO SOMETHING WITH RESPONSE HERE}, function(error){// DO SOMETHING WITH ERROR HERE});

N/record Module
record.detach.promise()
Method Description: Detaches a record from another record asynchronously. The parameters and errors thrown for this method are the same as those for record.detach(options). For more information on promises, see Promise Object.
Returns: Promise Object
Supported Script Types: Client-side scripts For more information, see SuiteScript 2.0 Client Script Type.
Governance: 10 units
Module: N/record Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=record.detach.promise(options)

Example:

// Code Example 1
// Add additional code.
//...
function detachRecord() {

var detachRecordPromise = record.detach.promise({
record: {
type: record.Type.CONTACT,
id: '98'
},
from: {
type: record.Type.OPPORTUNITY,
id: '16'
}
});

detachRecordPromise.then(function() {

// Add any other needed logic that shouldn't execute until
// after the contact record is detached from the opportunity.

log.debug({
title: 'Record updated',
details: 'Contact record detached'
});

}, function(e) {
log.error({
title: e.name,
details: e.message
});
});
}
...
// Add additional code.

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