Saturday, October 22, 2016

Search with WSO2 NetSuite Connector- Advanced Search

This is the final 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 advanced search in NetSuite.

Advanced search


An advanced search allows you to search for a record type in which you specify search filter fields and/or search return columns or joined search columns. Using advanced search, you can also return an existing saved search.

What is saved search?


A Saved Search is a reusable search definition that can have many advanced search filters and results display options.

To create a saved search
  • Go to Reports > Saved Searches > All Saved Searches > New and select the record type for the saved search.


  • On a saved search definition page, enter a title for the saved search.
  • If you want the search to be available to all users, check the Public box. 
  • On the Criteria subtab, define criteria to filter saved search records. These criteria can include dynamically calculated field values, including join fields; formulas containing SQL functions, as well as AND/OR expressions.


  • On the Results subtab, define display options for saved search results.
  • After you have completed saved search definitions, you can click preview to review search results without saving the search definitions.



  • Then click Return to Criteria button to go back to the saved search page and click Save to save search definitions and make the search available to be run by yourself and other members.

How to reference an existing saved search via NetSuite Connector?


First, you must obtain the saved search ID to reference an existing saved search. You can do so through the UI by going to Lists > Search > Saved Searches. The saved search ID appears in the ID column.



This request sample shows how to execute a saved search on customers via NetSuite connector, and you can use the proxy service mentioned in the first post to perform this.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<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_2016_1</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>
         <q1:searchRecord xmlns:q1="urn:relationships_2016_1.lists.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="q1:CustomerSearchAdvanced" savedSearchId="748" />
      </urn:searchRecord>
   </soapenv:Body>
</soapenv:Envelope>

No comments:

Post a Comment