Search for Oracle NetSuite Business Objects

You can configure a NetSuite search operation in the Adapter Endpoint Configuration Wizard.

The following types of search operations are supported:

Note:

NetSuite provides documentation about supported mapping values.

See SearchDateFieldOperator.

Search on a Selected Business Object

You can perform a search on the fields of a selected business object. The following use case provides an example of how to perform a search operation using the fields of a selected business object in an integration.

  • On the Operations page of the Adapter Endpoint Configuration Wizard, Search on selected Business Object and the business object (for this example, Customer (known as the basic business object)) are selected. This is the simplest search criteria. For this example, no processing options (for example, to return sublist values on search results) and no fields of associated business objects (known as subobjects) of Customer are selected, although they can be.

  • In the mapper, search criteria can be defined. The fields of the Customer business object are displayed in the target tree. There are no associated business objects and fields because none were selected during configuration in the Adapter Endpoint Configuration Wizard.

  • You can expand one or more fields and define search criteria by mapping the searchValue and operator. Based on the field type, one or more searchValue elements and operators can be required. For this example, search criteria are defined using the first name of the Customer object and specifying that it must contain ICSNetSuite.

  • A for-each action can be configured to individually read the search results of customer records (status of search, total records returned, page size, total pages, page index, search ID, and record list).

    The recordList is expanded to show that the Customer business object is returned. A looping repeating element can be run against Customer.

Search on a Selected Business Object and Related Objects

You can search on a selected business object and related objects. This type of search enables you to:

  • Search a business object using the associated business object fields as search filters.

  • Search a business object using a combination of business object fields and associated business object fields as search filters.

The following use case provides an example of this type of search criteria configuration in an integration.

  • On the Operations page of the Adapter Endpoint Configuration Wizard, Search on selected Business Object and related objects and the business object (for this example, Customer) are selected.

  • In the mapper, search criteria can be defined. The fields of the Customer (basic) business object and all associated business objects are displayed in the target tree.

    You can define search filters on the basic business object and any associated business objects. For this example, a search is performed on a customer name that includes ICSNetSuite with an associated opportunity that has a status of either of two values: inProgress or issuedEstimate.

  • A for-each action can be configured to return the search results of customer records (status of search, total records returned, page size, total pages, page index, search ID, and record list). This is the same response as in the basic search.

    The recordList is expanded to show that the Customer business object is returned. A looping repeating element is run against Customer.

  • A log action can be configured to return the first name and last name of the customer and concatenate them. This is the same configuration as in the basic search.

    concat ( firstName, lastName)

Search with a Saved Search

You can perform saved searches. This type of search enables you to perform searches that reference:

  • An existing saved search.

  • An existing saved search in which you override the existing search return columns with new search return columns.

  • An existing saved search in which you provide additional search filter criteria on top of the criteria already specified in the saved search.

The following use case provides an example of saved search criteria configuration in an integration.

  • On the Operations page of the Adapter Endpoint Configuration Wizard, Invoke a Saved Search. Also select columns to return and the business object (for this example, Customer) are selected.

  • On the Summary page of the Adapter Endpoint Configuration Wizard, the saved searches for the specific business object (Customer) are displayed.

  • When Test Search is clicked, the response column results selected for the business object of this search are verified. This type of configuration enables you to perform a search that references an existing saved search.

    Success! Note that it is likely that not every Response Column configured in the saved search
    would have been retrieved. Hence it is advised to check the below panel and manually add any 
    missing response columns as required.

    You can also override the return columns of the existing saved search with new search return columns.

  • By selecting Click to Add Response Columns on the Search Configuration page, the page is refreshed for selecting additional business objects and their fields. You can also click edit icon to edit an existing business object and its fields.

  • An additional associated business object (Partner) and field for that object (billAddress) are selected.

  • The Search Configuration page shows the new response column that overrides the response columns of the saved search.

    In a saved search, you do not need to define any additional mappings. This means that saved search criteria defined at the application level is used for that particular search.

    In the for-each action, only selected response columns appear in the response. Therefore, the Partner business object and billAddress field that were added to override the saved search do not appear.

    You only define mapping if you want to perform an existing saved search in which you provide additional search filter criteria on top of the criteria already specified in the saved search.

  • On the Search Configuration page for the saved search, Click to Add Response Columns is selected.

  • The BillingAccount associated business object and billingSchedule and currency fields are selected.

  • The for-each action shows the newly-added BillingAccount associated business object in the list of responses.

  • An additional mapper can be added to the integration in which more search criteria can be defined. For example, you can define criteria for the BillingAccount associated business object and billingSchedule and currency fields.

Search on a Selected Business Object and Related Objects and Selecting Columns to Return

You can perform a search on a selected business object and related objects and select the columns to return.

The following use case provides an example of this type of search criteria configuration in an integration.

  • On the Operations page, Search on selected Business Object and related objects. Also select columns to return and the business object (for this example, Customer) are selected.

  • On the Search Configurations page, the Customer object is displayed as part of the saved search. To specify the response columns to return, Click to Add Response Columns is selected.

  • The status response column is selected for the Opportunity associated business object.

  • The Customer business object and Opportunity associated business object are then displayed.

  • In the mapper, mappings can be defined on the fields of the Customer basic business object and associated subobjects. For this example, fields have been defined on the fields of the Customer basic business object.

  • A for-each action can be configured to return the response business objects selected on the Search Configuration page. The search results of the Customer business object (first name and last name) and Opportunity associated business object (status) are displayed.

Paginate Through the Search Results

You can paginate the display of search results for any of the search criteria.

The following use case provides an example of an integration configured to display five records per page of search results.

The LoopOverPages while action loops over all the pages. Within the loop, a LoopOverRecords for-each action is configured to loop over the records per page of search results.

  • On the Operations page of the Adapter Endpoint Configuration Wizard, Search on selected Business Object and the business object (for this example, Customer) are selected.

  • The Processing Options link on the Operations page is selected. The Search Page Size value is set to 5 to display five records per page of search results.

  • In the InitializeVariables assign action, three variables must be created and initialized with values (preferably a value of 1): PageIndex, SearchId, and TotalPages. The PageIndex value must be less than or equal to the TotalPages value. If not, the Oracle NetSuite Adapter is not invoked and the for-each loop that paginates through the search results does not run.

  • A LoopOverPages while action is configured to loop over the search results while the PageIndex value is less than or equal to the TotalPages value.

  • In the LoopOverRecords for-each action, totalPages, pageIndex, and searchId are used to paginate through the search results.

  • In the AssignVariables assign action before the loop ends, the pageIndex value returned from the search is incremented by one each time. The search ID from the response is mapped to searchId. The total number of pages from the response is mapped to totalPages.

  • In the mapper, the $pageIndex and $searchId variables must be mapped to the searchId and pageIndex values that are part of the request.