Friday, October 14, 2016

Search with WSO2 NetSuite Connector - Joined Search

This is the second post in the series, 'Search operation with WSO2 NetSuite Connector'. In this post, I am discussing how we can use search method in WSO2 NetSuite connector to perform the joined search in NetSuite.

Joined search


A joined search allows you to search for a specific record type using the fields on an associated record as search filters. 

In SuiteTalk, all search joins are listed in the < Record > Search object. For example, to find available search joins for the Contact or Customer record, see the relationships XSD.

You can use the proxy service mentioned in the first post to perform the joined search via WSO2 NetSuite connector.

This request sample shows how to execute a customer search in which the contact email address is specified as the search criteria.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="wso2.connector.netsuite">
   <soapenv:Header />
   <soapenv:Body>
      <urn:apiUrl>https://webservices.na1.netsuite.com/services/NetSuitePort_2015_2</urn:apiUrl>
      <urn:applicationId>32XXX75-CXXE-47X7-BX7-A3EXXXX9D</urn:applicationId>
      <urn:email>johndoe@abc.com</urn:email>
      <urn:password>john4doe</urn:password>
      <urn:account>TSTXXXXXX12</urn:account>
      <urn:searchRecord>
         <searchRecord xmlns:ns4="urn:relationships_2015_1.lists.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns4:ContactSearch">
            <ns4:basic xmlns:ns5="urn:common_2015_1.platform.webservices.netsuite.com" xsi:type="ns5:ContactSearchBasic">
               <ns5:email xmlns:ns6="urn:core_2015_1.platform.webservices.netsuite.com" operator="is" xsi:type="ns6:SearchStringField">
                  <ns6:searchValue xsi:type="xsd:string">dave@cleanenergy.com</ns6:searchValue>
               </ns5:email>
            </ns4:basic>
            <ns4:customerJoin xmlns:ns7="urn:common_2015_1.platform.webservices.netsuite.com" xsi:type="ns7:CustomerSearchBasic">
               <ns7:entityId xmlns:ns8="urn:core_2015_1.platform.webservices.netsuite.com" operator="is" xsi:type="ns8:SearchStringField">
                  <ns8:searchValue xsi:type="xsd:string">Clean Energy</ns8:searchValue>
               </ns7:entityId>
            </ns4:customerJoin>
         </searchRecord>
      </urn:searchRecord>
   </soapenv:Body>
</soapenv:Envelope>

No comments:

Post a Comment