getCustomizationId

When integrating with NetSuite through SOAP web services, in many cases, you will want to know which custom objects exist in an account. You may also want to obtain metadata for these custom objects so that your application can handle any business logic that is specific to the account.

To learn which custom objects exist in an account, use the getCustomizationId operation to retrieve the internalIds, externalIds, and/or scriptIds of all custom objects of a specified type. These types, enumerated in CustomizationType, include the following:

Note:

The CustomizationType object is defined in the coreTypes XSD.

After the IDs are returned, you can then pass the ID value(s) to either the get or getList operation to obtain metadata for specific custom objects (see Using get and getList with getCustomizationId for more details).

Note the following:

Using get and getList with getCustomizationId

If you want only the internalIds, externalIds, and/or scriptIds for custom objects of a specific type, you can call getCustomizationId on that custom type (for example, crmCustomField). However, if you also want the metadata for any or all of the custom objects referenced in the getCustomizationId response, you must invoke a get or getList request and specify each object's ID.

When using either the get or getList operations in conjunction with getCustomizationId, be aware of the following:

Request

The getCustomizationIdRequest type is used for this request. It contains the following fields:

Element Name

XSD Type

Notes

customizationType

CustomizationType

Any of the custom object types enumerated in CustomizationType.

includeInactives

boolean

A value of true or false is required. A value of false means no inactive custom objects are returned in the response.

A value of true means that both active and inactive custom objects are returned in the response.

  • To determine which of the returned custom objects are inactive, you must perform either a get or getList operation to obtain the metadata for the custom object type(s). For custom records and custom lists, the value is specified in the isInactive element.

  • Although the includeInactives argument is required, the value you set applies to custom record and custom list objects only. In NetSuite, custom fields cannot be set to active or inactive. Therefore, when using getCustomizationId on a custom field type, the value you specify for includeInactives will be ignored. Whether you specify true or false, all custom field objects (of the type specified in your request) will be returned.

Response

The getCustomizationIdResult type is used for the response. It contains the following fields:

Element Name

XSD Type

Notes

status

Status

The status for this operation. All applicable errors or warnings are listed within this type.

totalRecords

xsd:int

The total number of records for this request. Depending on the pageSize value, some or all the records may be returned in the response.

customizationRefList

CustomizationRef

A list of custom objects that correspond to the specified customization type. Also returns the internalId, externalId, and/or scriptId of each object.

Faults

This operation can throw one of the following faults. See SOAP Fault Status Codes for more information on faults.

Sample Code

The following sample is a two-part sample. The first part of the sample shows how to construct a getCustomizationId request so that the IDs for all custom record type objects in a NetSuite account are returned. Notice that in the getCustomizationId request, the value of the includeInactives parameter is set to false, meaning that only custom records marked as “active” in the account will be returned.

The second part of the sample shows how to take internalIds that are returned, and make a getList request to return the metadata for each custom record type.

C# Sample

          NetSuiteService nss = new NetSuiteService();

// credential code ignored here in this sample ...

// Perform getCustomizationId on custom record type
CustomizationType ct = new CustomizationType();
ct.getCustomizationTypeSpecified=true;
ct.getCustomizationType = GetCustomizationType.customRecordType;

// Retrieve active custom record type IDs. The includeInactives param is set to false.
GetCustomizationIdResult getCustIdResult = nss.getCustomizationId(ct, false);

// Retrieve the metadata of the returned custom record types
ReadResponse [] readResp = nss.getList(getCustIdResult.customizationRefList); 

        

SOAP Request (getCustomizationId)

                <soapenv:Body>           
         <getCustomizationId xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">               
            <customizationType getCustomizationType="customRecordType"/>               
            <includeInactives>false</includeInactives>           
         </getCustomizationId>       
      </soapenv:Body> 

        

SOAP Response (getCustomizationId)

          <getCustomizationIdResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
            <platformCore:getCustomizationIdResult
      xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com">
               <platformCore:status isSuccess="true"/>
               <platformCore:totalRecords>1</platformCore:totalRecords>
               <platformCore:customizationRefList>
                  <platformCore:customizationRef internalId="15" scriptId="customrecord15"
         type="customRecordType">
                     <platformCore:name>Customer Satisfaction Survey</platformCore:name>
                  </platformCore:customizationRef>
               </platformCore:customizationRefList>
            </platformCore:getCustomizationIdResult>
         </getCustomizationIdResponse> 

        

SOAP Request (getList)

                      <getList xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
               <baseRef xmlns:q1="urn:core_2017_1.platform.webservices.netsuite.com"
      xsi:type="q1:CustomizationRef" internalId="15" scriptId="customrecord15"
         type="customRecordType">
                  <q1:name>Customer Satisfaction Survey</q1:name>
               </baseRef>
            </getList> 

        

SOAP Response (getList)

           <getListResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
               <readResponseList>
                  <readResponse>
                     <platformCore:status isSuccess="true"
         xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
                     <record internalId="15" xsi:type="setupCustom:CustomRecordType"
         xmlns:setupCustom="urn:customization_2017_1.setup.webservices.netsuite.com">
                        <setupCustom:recordName>Customer Satisfaction Survey</setupCustom:recordName>
                        <setupCustom:includeName>true</setupCustom:includeName>
                        <setupCustom:showId>true</setupCustom:showId>
                        <setupCustom:showCreationDate>true</setupCustom:showCreationDate>
                        <setupCustom:showCreationDateOnList>true</setupCustom:showCreationDateOnList>
                        <setupCustom:isAvailableOffline>false</setupCustom:isAvailableOffline>
                        <setupCustom:allowQuickSearch>false</setupCustom:allowQuickSearch>
                        <setupCustom:isInactive>false</setupCustom:isInactive>
                        <setupCustom:disclaimer><b>Record numbers cannot be reverted back to names after being
            updated.<br/></setupCustom:disclaimer>
                        <setupCustom:enableNumbering>false</setupCustom:enableNumbering>
                        <setupCustom:numberingCurrentNumber>413</setupCustom:numberingCurrentNumber>
                        <setupCustom:allowNumberingOverride>false</setupCustom:allowNumberingOverride>
                        <setupCustom:isNumberingUpdateable>false</setupCustom:isNumberingUpdateable>
                        <setupCustom:scriptId>customrecord15</setupCustom:scriptId>
                        <setupCustom:fieldList>
                           <setupCustom:customField scriptId="customrecord_CONTACT_TYPE">
                              <setupCustom:label>Contact type</setupCustom:label>
                              <setupCustom:fieldType>_listRecord</setupCustom:fieldType>
                              <setupCustom:selectRecordType internalId="16"
            xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com">
                                 <platformCore:name>Customer contact type</platformCore:name>
                              </setupCustom:selectRecordType>
                              <setupCustom:storeValue>true</setupCustom:storeValue>
                              <setupCustom:showInList>false</setupCustom:showInList>
                              <setupCustom:globalSearch>false</setupCustom:globalSearch>
                              <setupCustom:isParent>false</setupCustom:isParent>
                              <setupCustom:displayType>_normal</setupCustom:displayType>
                              <setupCustom:isMandatory>true</setupCustom:isMandatory>
                              <setupCustom:checkSpelling>false</setupCustom:checkSpelling>
                              <setupCustom:defaultChecked>false</setupCustom:defaultChecked>
                              <setupCustom:isFormula>false</setupCustom:isFormula>
                              <setupCustom:recType>15</setupCustom:recType>
                              <setupCustom:roleRestrict>false</setupCustom:roleRestrict>
                              <setupCustom:accessLevel>_edit</setupCustom:accessLevel>
                              <setupCustom:searchLevel>_edit</setupCustom:searchLevel>
                           </setupCustom:customField>
                           <setupCustom:customField scriptId="customrecord_IF_OTHER">
                              <setupCustom:label>Other contact type</setupCustom:label>
                              <setupCustom:fieldType>_freeFormText</setupCustom:fieldType>
                              <setupCustom:storeValue>true</setupCustom:storeValue>
                              <setupCustom:showInList>false</setupCustom:showInList>
                              <setupCustom:globalSearch>false</setupCustom:globalSearch>
                              <setupCustom:isParent>false</setupCustom:isParent>
                              <setupCustom:displayType>_normal</setupCustom:displayType>
                              <setupCustom:displayWidth>42</setupCustom:displayWidth>
                              <setupCustom:isMandatory>false</setupCustom:isMandatory>
                              <setupCustom:checkSpelling>false</setupCustom:checkSpelling>
                              <setupCustom:defaultChecked>false</setupCustom:defaultChecked>
                              <setupCustom:isFormula>false</setupCustom:isFormula>
                              <setupCustom:recType>15</setupCustom:recType>
                              <setupCustom:roleRestrict>false</setupCustom:roleRestrict>
                              <setupCustom:accessLevel>_edit</setupCustom:accessLevel>
                              <setupCustom:searchLevel>_edit</setupCustom:searchLevel>
                           </setupCustom:customField>
 
            // custom field list continues ...

                     </setupCustom:fieldList>
                     <setupCustom:formsList>
                           <setupCustom:forms>
                              <setupCustom:formName>Standard Customer Satisfaction Survey
            Form<setupCustom:formName>
                              <setupCustom:formPref>false</setupCustom:formPref>
                           </setupCustom:forms>
                        </setupCustom:formsList>
                        <setupCustom:parentsList>
                           <setupCustom:parents>
                              <setupCustom:childDescr>Customer</setupCustom:childDescr>
                           </setupCustom:parents>
                        </setupCustom:parentsList>
                     </record>
                  </readResponse>
               </readResponseList>
            </getListResponse> 

        

SOAP Request for Returning Custom Segments

                <soapenv:Body>                    
         <getCustomizationId xmlns="urn:messages_2019_1.platform.webservices.netsuite.com">                           
            <customizationType getCustomizationType="customSegment"/>                           
            <includeInactives>false</includeInactives>                    
         </getCustomizationId>             
      </soapenv:Body 

        

SOAP Response with Unified Script ID Used on the Custom Segment

                <soapenv:Body>
         <getCustomizationIdResponse xmlns="urn:messages_2019_1.platform.webservices.netsuite.com">
            <platformCore:getCustomizationIdResult xmlns:platformCore="urn:core_2019_1.platform.webservices.netsuite.com">
               <platformCore:status isSuccess="true"/>
               <platformCore:totalRecords>1</platformCore:totalRecords>
               <platformCore:customizationRefList>
                  <platformCore:customizationRef scriptId="cseg_testws" internalId="1" type="customSegment">
                     <platformCore:name>TestWS</platformCore:name>
                  </platformCore:customizationRef>
               </platformCore:customizationRefList>
            </platformCore:getCustomizationIdResult>
         </getCustomizationIdResponse>
      </soapenv:Body> 

        

Java Sample

The following Java sample show how to construct a getCustomizationId request so that the IDs for all custom record type objects are returned. In this example, inactive custom record type objects are not returned.

          // Perform getCustomizationId operation on the custom record type

    public void getCustomizationId () throws Exception {
        CustomizationType ct = new CustomizationType();
        ct.setGetCustomizationType(GetCustomizationType.entityCustomField);
        ct.getGetCustomizationType();

        c.getCustomizationId(GetCustomizationType.customRecordType, false); 

        

Related Topics

General Notices