How Custom Fields Are Identified in Search Results

When executing an advanced search, you might choose to include as part of your search results values from custom fields. In some cases, the way that the system identifies these values varies depending on which endpoint you are using. For many users, this difference might not be of great consequence. However, you may want to review this information if you are upgrading from a previous endpoint to the 2013.2 WSDL or later, and if your integration depends on these values.

Specifically, this difference applies to scenarios in which you execute an advanced search, join to a record that has a custom field, and include the custom field in your search results. With 2013.1 and earlier endpoints, the system in its response adds a prefix to the string used to identify the custom field. In 2013.2 and later, this prefix is not added.

For example, suppose you had a custom item field on your inventory item record, and this custom field had an ID of custitem_style.

Custom fields in search results.

First, note that this value is referred to as internalId when using 2013.1 or an earlier endpoint. With 2013.2 and later endpoints, the value is called scriptId.

Second, with older endpoints, in some cases, the system modifies this value slightly. For example: Suppose you executed a TransactionSearchAdvanced and joined to the item record. If you included in your search results the custom field pictured above, the 2013.1 endpoint, or an earlier one, would identify the field’s internalId as having a value of “item_custitem_style.” That is, in this particular scenario, the system would add the “item_” prefix. With a different type of join, a different prefix would be added.

If you are using the 2013.2 endpoint or later, the system does not add a prefix. The scriptId returned in the response is the same as in the request (“custitem_style,” in this example). Therefore, if you upgrade to 2013.2 or a later WSDL and if you have integrations that depend on this value, you must modify these integrations.

Note:

For code samples in Java and C#, see Searching for a Multi-select Custom Field.

Behavior with 2013.1 and Earlier Endpoints Example

In the following example, the user executes a TransactionSearchAdvanced operation with a join to the item record. The user is searching for estimates that are associated with inventory items. In the results, the user wants to include the value of the custom field with the internalId “custitem_color.”

          <soapenv:Body> 
   <platformMsgs:search> 
      <platformMsgs:searchRecord xsi:type="s0:TransactionSearchAdvanced"> 
         <s0:criteria> 
            <s0:basic> 
               <platformCommon:internalId operator="anyOf"> 
                  <platformCore:searchValue internalId="11962" type="estimate" /> 
               </platformCommon:internalId> 
               <platformCommon:type operator="anyOf"> 
                  <platformCore:searchValue>_estimate</platformCore:searchValue> 
               </platformCommon:type> 
            </s0:basic> 
            <s0:itemJoin> 
               <platformCommon:type operator="anyOf"> 
                  <platformCore:searchValue>_inventoryItem</platformCore:searchValue> 
               </platformCommon:type> 
            </s0:itemJoin> 
         </s0:criteria> 
         <s0:columns> 
            <s0:itemJoin> 
               <platformCommon:customFieldList> 
                  <platformCore:customField xsi:type="platformCore:SearchColumnSelectCustomField" internalId="custitem_color" /> 
              </platformCommon:customFieldList> 
            </s0:itemJoin> 
         </s0:columns> 
      </platformMsgs:searchRecord> 
   </platformMsgs:search> 
</soapenv:Body> 

        

The response might look like the following. Note that the internalId value is now “item_custitem_color.”

          <platformCore:searchRowList> 
   <platformCore:searchRow xsi:type="tranSales:TransactionSearchRow" xmlns:tranSales="urn:sales_2017_1.transactions.webservices.netsuite.com"> 
      <tranSales:itemJoin xmlns:platformCommon="urn:common_2017_1.platform.webservices.netsuite.com"> 
         <platformCommon:customFieldList> 
            <platformCore:customField internalId="item_custitem_color" xsi:type="platformCore:SearchColumnSelectCustomField"> 
               <platformCore:searchValue internalId="1" typeId="6" /> 
            </platformCore:customField> 
         </platformCommon:customFieldList> 
      </tranSales:itemJoin> 
   </platformCore:searchRow> 
</platformCore:searchRowList> 

        

Behavior with 2013.2 and Later Endpoints Example

The SOAP request below represents another TransactionSearchAdvanced that joins to the item record. (In this example, because the 2013.2 WSDL is being used, the “custitem_color” value is identified as the scriptId, rather than internalId.)

          <soapenv:Body>  
   <search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">   
      <searchRecord xsi:type="ns6:TransactionSearchAdvanced" xmlns:ns6="urn:sales_2017_1.transactions.webservices.netsuite.com">    
         <ns6:criteria xsi:type="ns6:TransactionSearch">     
            <ns6:basic xsi:type="ns7:TransactionSearchBasic" xmlns:ns7="urn:common_2017_1.platform.webservices.netsuite.com">      
               <ns7:internalId operator="anyOf" xsi:type="ns8:SearchMultiSelectField" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com">
                  <ns8:searchValue internalId="67" xsi:type="ns8:RecordRef"/>      
               </ns7:internalId>      
           <ns7:type operator="anyOf" xsi:type="ns9:SearchEnumMultiSelectField" xmlns:ns9="urn:core_2017_1.platform.webservices.netsuite.com">
                  <ns9:searchValue xsi:type="xsd:string">_estimate</ns9:searchValue>      
           </ns7:type>     
            </ns6:basic>    
            </ns6:criteria>    
            <ns6:columns xsi:type="ns6:TransactionSearchRow">     
               <ns6:itemJoin xsi:type="ns10:ItemSearchRowBasic" xmlns:ns10="urn:common_2017_1.platform.webservices.netsuite.com">      
                  <ns10:customFieldList xsi:type="ns11:SearchColumnCustomFieldList" xmlns:ns11="urn:core_2017_1.platform.webservices.netsuite.com">
                     <ns11:customField scriptId="custitem_color" xsi:type="ns11:SearchColumnSelectCustomField"/>      
                  </ns10:customFieldList>     
               </ns6:itemJoin>    
            </ns6:columns>   
         </searchRecord>  
      </search> 
</soapenv:Body> 

        

In the SOAP response, the scriptId value – “custitem_color” – is unchanged. No prefix has been added.

          <platformCore:searchRowList>
  <platformCore:searchRow xsi:type="tranSales:TransactionSearchRow" xmlns:tranSales="urn:sales_2017_1.transactions.webservices.netsuite.com">
     <tranSales:itemJoin xmlns:platformCommon="urn:common_2017_1.platform.webservices.netsuite.com">
        <platformCommon:customFieldList>
           <platformCore:customField internalId="211" scriptId="custitem_color" xsi:type="platformCore:SearchColumnSelectCustomField">
              <platformCore:searchValue internalId="1" typeId="28"/>
           </platformCore:customField>
        </platformCommon:customFieldList>
     </tranSales:itemJoin>
  </platformCore:searchRow>
</platformCore:searchRowList> 

        

Related Topics

search
Basic Searches in SOAP Web Services
Joined Searches in SOAP Web Services
Advanced Searches in SOAP Web Services
Joining Through Custom Fields
Setting Valid Search Values
Setting the anyof, mine, or myteam Filtering Values
Searching by lastModifiedDate
Understanding Sorting in Advanced Search
Search-Related Sample Code
Searching for a Multi-select Custom Field
Search Issues and Best Practices for SOAP Web Services and SuiteScript

General Notices