---
title: Update
slug: netsuite/voGI-update
description: Learn how to update a Custom Object Record in NetSuite with this detailed example. The code demonstrates updating various fields, such as name and isInactive status, as well as adding values to custom fields. Explore the step-by-step process and see the A
docTags: 
createdAt: 2022-03-29T09:11:49.000Z
---

The following is an example of updating the Custom Object Record, where we are changing some of the fields. (See [Custom Object](docId\:fGPsbggFpzat8WQLDCqU1) for all available fields).  The NetSuite Custom Object Record Id (internalId) is required to update the Custom Object Record.

:::hint{type="info"}
Note: You can only create one record at a time.
:::

The response returns the complete Custom Object Record information, but we have shortened the response in our example for ease of reading.

:::CodeblockTabs
Request

```apex
//  Create a Map to store all the data of a Custom Object
Map<String, Object> nsCustomObject = new Map<String, Object>();
    nsCustomObject.put('internalId', '808');
    nsCustomObject.put('name', 'Custom Record-2 update');
	nsCustomObject.put('isInactive', true);
         
    //  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 update');
        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', 'updateCustomObjectRecord');
    reqObj.put('requestJSON', reqJSON);
    
//  Placing a request to Breadwinner Global API
Map<String, Object> resp = breadwinner_ns.BreadwinnerNetSuiteAPI.call(reqObj);
System.debug(resp);
```

Response

```json
{
 action=updateCustomObjectRecord,
 timestamp=1648549432123, 
 validRequest=true, 
 version=1.0, 
 responseJSON={
   "errors":[],
   "status":"200",	
   "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
      }
   ]
 }
}
```
:::

