Joined Searches in SOAP Web Services

See the following topics to learn how to execute a joined search in NetSuite using SOAP web services:

Joined Searches

A joined search allows you search against a specific record type using the fields on an associated record as search filters. In the UI, you can identify which associated records provide joined filter criteria by first navigating to a record's search interface. For example, for the Customer search interface, go to Lists > Relationships > Customers > Search.

Check the Use Advanced Search box and wait for the page to update. Then scroll through the Filter dropdown list. Joined search records are indicated by the record name followed by an ellipsis (....). Search fields from any of the records listed (that are also currently exposed in SOAP web services) can be included in the search criteria.

An example of a joined search in the UI.
Note:

For a list of SOAP web services-supported records, see SOAP Web Services Supported Records.

SOAP Objects Used in a Joined Search

To perform a joined search in which you use search filter criteria from an associated record, use:

  1. < Record > Search

  2. < Record > SearchBasic

For more details, see Joined Search Objects Explained and Joined Search Code Samples.

Joined Search Objects Explained

In SOAP web services, all search joins are listed in the < Record > Search object. For example, to find available search joins for the Contact or Employee record, see the ContactSearch and EmployeeSearch XSDs, respectively.

The snippet below shows the CustomerSearch object, which includes < xxx > Join elements. These elements reference search criteria available from other SOAP-supported records.

          <complexType name=" CustomerSearch ">
        <complexContent>
            <extension base="platformCore:SearchRecord">
                <sequence>
                    <element name="basic" type="platformCommon:CustomerSearchBasic" minOccurs="0"/>
                    <element name=" callJoin " type="platformCommon: PhoneCallSearchBasic " minOccurs="0"/>
                    <element name=" campaignResponseJoin " type="platformCommon: CampaignSearchBasic "
         minOccurs="0"/>
                    <element name=" caseJoin " type="platformCommon: SupportCaseSearchBasic " minOccurs="0"/>
      .....
                
      </sequence>
            </extension>
        </complexContent>
    </complexType> 

        

In this case, all search filter criteria from the PhoneCallSearchBasic, CampaignSearchBasic, and SupportCaseSearchBasic objects are available to the Customer record as joined search filters. Note that all < Record > SearchBasic objects in NetSuite SOAP web services are defined in the platformCommon XSD.

For a code sample of a joined search, see Joined Search Code Samples.

Important:

Only fields on SOAP-supported records can be specified as filter criteria for a joined search request. For a list of SOAP-supported records, see SOAP Web Services Supported Records.

Returning an Associated Joined List of Records

Using a combination of joined search and the internalId list on each record, you can retrieve a list of records for an associated list of records. For example, you can retrieve a list of contacts for a specific list of customers. To do this, you must first retrieve the desired list of internalIds for the record you need to retrieve by, and then submit that list in a joined search query to retrieve the associated list.

See Joined Search Code Samples for an example of a joined search which uses a list of records.

Related Topics

search
Basic 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