Global API
Requests

Attach Contact

1min
netsuite contact can be attached as a primary contact to transaction and other records in netsuite example to attach an existing contact record as primary contact to a sales order request map\<string, object> nsattachreference = new map\<string, object>(); nsattachreference put('attachto', new map\<string, object>{'internalid'=>'120956','type'=>'salesorder'}); nsattachreference put('contact', new map\<string, object>{'internalid'=>'15959'}); map\<string, object> nsattachment = new map\<string, object>(); nsattachment put('attachreference',nsattachreference); // initialize the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('attachcontacts', new list\<object>{nsattachment}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'attachcontact'); reqobj put('requestjson', reqjson); // placing a request to breadwinner global api map\<string, object> resp = breadwinner ns breadwinnernetsuiteapi call(reqobj); system debug(resp); example to attach an existing contact record as primary contact to a customer request map\<string, object> nsattachreference = new map\<string, object>(); nsattachreference put('attachto', new map\<string, object>{'internalid'=>'10341','type'=>'customer'}); nsattachreference put('contact', new map\<string, object>{'internalid'=>'15959'}); map\<string, object> nsattachment = new map\<string, object>(); nsattachment put('attachreference',nsattachreference); // initialize the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('attachcontacts', new list\<object>{nsattachment}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'attachcontact'); reqobj put('requestjson', reqjson); // placing a request to breadwinner global api map\<string, object> resp = breadwinner ns breadwinnernetsuiteapi call(reqobj); system debug(resp);