01
NetSuite StorageKnow more

This blog will guide you through performing search operations using the NetSuite connector in MuleSoft.NetSuite searches can be executed in two main ways:
savedSearchId
.In this example, we will focus on executing a saved search by sending a SOAP request from MuleSoft to NetSuite. (SOAP, or Simple Object Access Protocol, is a protocol for exchanging structured information in web services using XML as the message format, enabling communication between applications over a network.)
Before diving in, it’s recommended to familiarize yourself with creating an XML file using DataWeave.
Add the NetSuite connector to your project by dragging and dropping it from the Add Module section into your Mule palette.
Drag the Search Operation from the Mule palette.
Click the plus icon to configure the NetSuite connector and fill in the required fields.
Add a Transform Message shape before the NetSuite Search Operation. Expand it and write the DataWeave code for your request.Use Case: Retrieve item saved search results from NetSuite with savedSearchId: '5927'
.
The resulting XML request will look like this:
Code Walkthrough:
ns prefix <namespace URI>
ns ns0 urn:messages_2020_2.platform.webservices.netsuite.com
_2020_2
indicates the NetSuite version, which must match the SOAP port configured in the NetSuite connector.searchRecord
field.searchRecord
, you can either:savedSearchId
with the ItemSearchAdvanced
type.ItemSearch
type.Example 1: Using savedSearchId
ItemSearchAdvanced
.savedSearchId
or savedSearchScriptId
as attributes.Example 2: Creating Criteria in the Request
ItemSearch
as the type and define criteria within the request.Use Case: Search for items with:
internalId: "1"
)Code Walkthrough for Criteria-Based Search:
search
field under the message namespace.searchRecord
, select the normal search type (ItemSearch
).basic
, which is of type ItemSearchBasic
, define:type
operation
and searchValue
searchValue
pairs can be separated by commas.location
recordRef
internalId
as an attribute.Add a Transform Message shape to process and display the final search result.
By following these steps, you can effectively perform search operations using the NetSuite connector in MuleSoft, whether by utilizing predefined saved searches or creating custom criteria within MuleSoft. These methods enable seamless integration with NetSuite and streamline data retrieval processes, making it easier to manage and manipulate data for your business needs.
If you’re ready to optimize your NetSuite workflows with MuleSoft or need expert guidance, contact us today to get started.