NetSuite Get List Operation through MuleSoft — Part 7

Muneeb Shaik
3 min readMay 31, 2023

--

In our last blog we have seen how to perform Add List Operation using NetSuite Connector in Mulesoft by inserting a list of Customer records as an example. In this blog we will see how to perform Get List Operation using the NetSuite Get list Connector in MuleSoft.

Business Use-Case:

Suppose you have an e-commerce application that needs to retrieve a list of sales orders from NetSuite for a particular customer. You can use the NetSuite GetList Connector in MuleSoft to achieve this.

  1. First, you would create a search on NetSuite to retrieve the sales orders based on the customer’s ID.
  2. Next, you would use the NetSuite GetList Connector in MuleSoft to call the custom list and retrieve the list of sales orders.
  3. The sales orders could then be processed in MuleSoft and passed on to other systems as needed, such as a fulfilment system for processing and shipping the orders.

Get List Operation:

The getList operation is used to retrieve a list of one or more records by providing the internal ids that identify those records. If there are multiple ids provided, they can either belong to the same record type or different record types. For example, it is possible to retrieve a customer and a contact within a single request using this operation or it is possible to retrieve multiple customer records within a single request using this operation.

Let’s demonstrate the Get list operation with a simple POC. In the getlist-customer-flow as shown in the below screenshot, NetSuite Get list Connector retrieves one or multiple records based on the NetSuite internalId provided for the corresponding record type.

First, set up a HTTP Listener with a path and configure connection. and then add a transform message which will have the input payload. Sample input payload can be seen in the below screenshot where two different record types are defined with the internal id of the record

Then add a NetSuite Get list connector into the flow. In the Get list connector, there will be two drop-down lists (Ref type and Type), in Ref types, select the nature of the record, whether it is a custom record or a record given by NetSuite i.e.RecordRef and Type can be leave as empty as shown in the below screenshot

Then add a Transform message before the Get list connector and metadata will be generated automatically.

Transform the input payload to the desired XML which will be passed as input to fetch records from NetSuite, xsi schema needs to be defined in the code to make the operation work as shown in the below screenshot

And at the end of the flow add a Transform message and convert the output to JSON. Once the flow is triggered, NetSuite Getlist Connector will fetch the details for the given internal Ids.

Sample Response:

Conclusion

In this blog, we have seen how to perform Get List Operation using the NetSuite connector in MuleSoft.

--

--