ANS-1090 · WEB SERVICES & INTEGRATIONS

How to Assign a Contact Role to a Customer via NetSuite Integration?

This guide explains the process of linking contacts to customer records and defining their specific roles using NetSuite's SuiteTalk Web Services.

Short answer

To assign a contact role to a customer in NetSuite via integration, utilize the `attach` operation within SuiteTalk Web Services. This operation allows for the association of a contact record with a customer record, specifying the desired contact role through an XML request. Ensure current WSDL versions are used and be aware of the deprecation of SOAP Web Services.

Scenario

Organizations often need to integrate external systems with NetSuite to manage customer relationships. A common requirement is to associate specific contacts with customer records and define their roles, such as 'Primary Contact' or 'Billing Contact'. This integration ensures that customer information is comprehensive and accurately reflects the relationships within the business.

Solution

To assign a contact role to a customer record through NetSuite integration, the attach operation is utilized within SuiteTalk SOAP Web Services. This operation facilitates the linking of a contact to a customer and the specification of their role.

For detailed information on the attach and detach operations, refer to the NetSuite Help Center documentation:

https://system.netsuite.com/help/helpcenter/en_US/Output/Help/SuiteCloudCustomizationScriptingWebServices/SuiteTalkWebServices/attachdetach.html

An example XML request for attaching a contact with a specific role to a customer is provided below. Note that the WSDL namespaces should reflect a current supported version (e.g., 2025.2) for optimal compatibility.

xml
<attach xmlns="urn:messages_2025_2.platform.webservices.netsuite.com">
  <attachReference xsi:type="ns1:AttachContactReference"
        xmlns:ns1="urn:core_2025_2.platform.webservices.netsuite.com">
      <ns1:attachTo internalId="176" type="customer" xsi:type="ns1:RecordRef">
        <ns1:name xsi:type="xsd:string">Adelina Shonkwiler</ns1:name>
          </ns1:attachTo>
       <ns1:contact internalId="1467" xsi:type="ns1:RecordRef"/>
         <ns1:contactRole internalId="-10" xsi:type="ns1:RecordRef">
            <ns1:name xsi:type="xsd:string">Primary Contact</ns1:name>
          </ns1:contactRole>
   </attachReference>
 </attach>

Important Note:

While the attach operation is currently available in SuiteTalk SOAP Web Services, NetSuite is actively deprecating SOAP Web Services, with full removal scheduled by 2028.2. For new integrations, NetSuite recommends utilizing REST Web Services.

Expert NetSuite Support

Need help with this NetSuite issue?

Web Services & Integrations consulting and configuration support

Talk to a consultant