Global API
...
Requests
Custom Object

Create

1min
to create a custom object record in netsuite, use action as "createcustomobjectrecord" and pass the custom object record data in the requestjson under "customobjectrecords" note you can only create one record at a time the following is an example of creating a custom object record where we are setting every possible field (see https //app archbee io/docs/ lihuunv 7xnqrtzhskkc/hnjmkn99qxwdeafyyifsq https //app archbee io/docs/ lihuunv 7xnqrtzhskkc/emqjiknclze b zi9pinn custom object docid\ fgpsbggfpzat8wqldcqu1 for the available fields) the response will return the response back from netsuite, which includes the netsuite custom object record id (internalid), plus the newly created salesforce custom object record id (salesforceid) request // create a map to store all the data of a custom object map\<string, object> nscustomobject = new map\<string, object>(); nscustomobject put('name', 'custom record 2'); &#x9;nscustomobject put('isinactive', false); // initializing the custom object custom fields list\<object> customobjectcustomfieldlist = new list\<object>(); map\<string,object> customobjectcustomfield = new map\<string,object>(); customobjectcustomfield put('fieldtype', 'string'); customobjectcustomfield put('scriptid', 'custrecord172'); customobjectcustomfield put('value', 'custom field value 1'); customobjectcustomfieldlist add(customobjectcustomfield); // adding the custom object custom fields nscustomobject put('customfieldlist', new map\<string,object>{'customfield'=>customobjectcustomfieldlist}); // initializing the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('customobjectrecords', new list\<object>{nscustomobject}); requestjsonmap put('customobjectid', '11'); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version', '1 0'); reqobj put('action', 'createcustomobjectrecord'); reqobj put('requestjson', reqjson); // placing a request to breadwinner global api map\<string, object> resp = breadwinner ns breadwinnernetsuiteapi call(reqobj); system debug(resp); response { action=createcustomobjectrecord, timestamp=1648544293785, validrequest=true, version=1 0, responsejson={ "errors" \[], "status" "200",&#x9; "customobjectrecords" \[ { "salesforceid" "a0z0l000006nnooeak", "rectype" { "name" "brand list", "internalid" "11" }, "owner" { "name" "navaneeth d", "internalid" "4" }, "name" "custom record 2", "lastmodified" 1648544292, "isinactive"\ false, "internalid" "808", "customfieldlist" { "customfield" \[ { "valuelookup"\ null, "value array"\ null, "value" "custom field value 1", "scriptid" "custrecord172", "label"\ null, "isparent"\ null, "ismandatory"\ null, "isformula"\ null, "internalid" "675", "fieldtype"\ null, "displaytype"\ null, "description"\ null, "defaultvalue"\ null, "defaultchecked"\ null, "accesslevel"\ null } ] }, "created" 1648544292 } ] } }