---
title: Creation of Parent Custom Object Record
slug: netsuite/creation-of-parent-custom-object-record
description: Learn how to create a parent custom object record in NetSuite with this comprehensive document. It covers the entire process, including setting all the available fields and even includes a code block in Apex language for easy reference. Discover the respo
docTags: 
createdAt: 2023-08-10T12:32:19.918Z
---

The following is an example of creating a Parent 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 exact request data plus the new NetSuite Custom Object record Id (internalId) and the newly created Salesforce Custom Object record Id (salesforceID).

:::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('name', 'Parent Object Record');
	nsCustomObject.put('isInactive', false);
         
//  Initializing the Custom Object Custom Fields
    List<Object> customObjectCustomFieldList = new List<Object>();
    
    Map<String,Object> customObjectCustomField1 = new Map<String,Object>();
        customObjectCustomField1.put('fieldType', 'string');
        customObjectCustomField1.put('scriptId', 'custrecordphone');
        customObjectCustomField1.put('value', '9809876567');
        customObjectCustomFieldList.add(customObjectCustomField1);
    
    Map<String,Object> customObjectCustomField2 = new Map<String,Object>();
        customObjectCustomField2.put('fieldType', 'double');
        customObjectCustomField2.put('scriptId', 'custrecord6');
        customObjectCustomField2.put('value', 90.0);
        customObjectCustomFieldList.add(customObjectCustomField2);
            
//  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', '17');
    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

```json
{
  action=createCustomObjectRecord,
  timestamp=1691672869384,
  validRequest=true,
  version=1.0,
  responseJSON={
    "errors": [],
    "status": "200"
    "customObjectRecords": [
      {
        "salesforceID": "a071e000003tZRiAAM",
        "recType": {
          "name": "Prestructured",
          "internalId": "17"
        },
        "owner": {
          "name": "Praveena U",
          "internalId": "4"
        },
        "name": "Parent Object Record",
        "lastModified": null,
        "isInactive": false,
        "internalId": "2626",
        "customFieldList": {
          "customField": [
            {
              "valueLookup": null,
              "value_array": null,
              "value": "false",
              "scriptId": "custrecord3",
              "label": null,
              "isParent": null,
              "isMandatory": null,
              "isFormula": null,
              "internalId": "212",
              "fieldType": null,
              "displayType": null,
              "description": null,
              "defaultValue": null,
              "defaultChecked": null,
              "accessLevel": null
            },
            {
              "valueLookup": null,
              "value_array": null,
              "value": "9809876567",
              "scriptId": "custrecordphone",
              "label": null,
              "isParent": null,
              "isMandatory": null,
              "isFormula": null,
              "internalId": "215",
              "fieldType": null,
              "displayType": null,
              "description": null,
              "defaultValue": null,
              "defaultChecked": null,
              "accessLevel": null
            },
            {
              "valueLookup": null,
              "value_array": null,
              "value": "90.0",
              "scriptId": "custrecord6",
              "label": null,
              "isParent": null,
              "isMandatory": null,
              "isFormula": null,
              "internalId": "217",
              "fieldType": null,
              "displayType": null,
              "description": null,
              "defaultValue": null,
              "defaultChecked": null,
              "accessLevel": null
            }
          ]
        },
        "created": null
      }
    ]
  }
```
:::

