Everything NetSuite

A Blog by Dave Weiss

Get NetSuite Customizations via the SuiteTalk API

By Dave Weiss, Published on November 14th, 2021
Tags: SuiteTalk Code

I often see questions posted on various forums asking how to determine what customizations exist within a NetSuite account. Here's how you do it...

I'm using the Spaulding Ridge SuiteTalk connector for PHP to show you how this is done. The connector is an object-oriented, easy to understand and utilize solution that makes interacting with SuiteTalk a breeze.

First, you execute the "getCustomizationId" method within the API. That method will return an array of customization references. You can simply loop through the array and perform a "get" operation on each element. Of course, I've included a check of the "Status" returned in NetSuite's response to each call to make sure the call returned successfully. You could alternatively execute a "getList" operation, passing in an array of recordRef objects.

<?php

        $cfs 
$this->client->getCustomizationId(
            new 
GetCustomizationIdRequest(
                new 
CustomizationType(
                    
GetCustomizationType::entityCustomField
                
), 
                
false
            
)
        )->
getGetCustomizationIdResult();
       
        if (
$cfs->getStatus()->getIsSuccess()) {
            foreach(
                
$cfs
                    
->getCustomizationRefList()
                    ->
getCustomizationRef() as $cf
            
)
            {
                
$gr = new GetRequest(
                    new 
RecordRef(
                        
$cf->getInternalId(), null$cf->getType()
                    )
                );
                
$rr $this->client->get($gr)->getReadResponse();
                if (
$rr->getStatus()->getIsSuccess()){
                    
print_r($rr->getRecord());
                }
            }
        }
?>