Contact Free trial Login
+
+

Anypoint Exchange

Home to the complete listing of connectors, templates, examples and APIs.
Discover and use proven assets built by the MuleSoft ecosystem, or add assets to a private
tenant of Anypoint Exchange for collaboration and sharing of internal best practices.

Retrieving a List of Customers from NetSuite

Retrieving a List of Customers from NetSuite

(0 reviews)

Anypoint Connector for NetSuite synchronizes data and automates business processes between NetSuite and third party applications, either on-premise or in the cloud. This example shows you how to use the NetSuite connector in an Anypoint integration application.

913bfc50-RetrievingaListofCustomersfromNetSuite.png

Prequisites

This document assumes that you are familiar with NetSuite, Mule, Anypoint connectors, Anypoint Studio, elements in a Mule flow, and global elements.

Example Use Case

This application connects to NetSuite to retrieve a list of customers based on the predefined criteria (all customers that have a last name that starts with 'a'). The data is then parsed and formatted to improve readability and is displayed in the web browser for the end user.

Set Up and Run the Example

Complete the following procedure to create, then run this example in your own instance of Anypoint Studio.

  1. Open the Example project in Anypoint Studio from Anypoint Exchange.
  2. Replace http.port parameter in http:listener-config element with the valid value (for example: 8081).
  3. Log in to your NetSuite account. You need the login email (netsuite.email) and the password (netsuite.password) to connect to NetSuite using the connector later in this topic.
  4. Choose Setup > Integration > Web Services Preferences from the main menu. Store the value ACCOUNT ID to use as a netsuite.account parameter.
  5. On the same page, if not present, insert a row into the table with your Name and a Web Services Default Role. Store the Role ID to use as a netsuite.roleId parameter.
  6. In your application in Studio, click the Global Elements tab.
  7. Double-click the NetSuite global element to open its Global Element Properties panel. Configure it as follows: Email netsuite.emailPassword netsuite.passwordAccount netsuite.accountRole Id netsuite.roleId
You should verify the configuration by clicking Test Connection button. Alternatively, you can also configure the global element in the XML Editor.
  1. In the Package Explorer, right-click the get-customer-list-from-netsuite project name, and select Run As > Mule Application. Studio runs the application on the embedded server.
  2. Browse to http://localhost:8081/customers?lastName=a to retrieve a list of all customers having a last name starting with a. The data is stored in the HTML table.
  3. Stop the Mule application by clicking the square, red terminate button in the Console.

How it Works

Using a single flow, this application accepts incoming HTTP requests, performs a query in NetSuite and delivers results to the end user.

The HTTP connector listens at http://localhost:8081/customers to incoming HTTP Get requests. The dynamic part of the NetSuite customer query is extracted from the URL under lastName parameter key using DataWeave. Next, the DataWeave expression block iterates over the returned collection and prepares an HTML table body that is sent to a Parse Template component that injects it into the HTML template.

Documentation

Studio includes a feature that enables you to easily export all the documentation you have recorded for your project. Whenever you want to share your project with others outside the Studio environment, you can export the project's documentation to print, email or share online. Studio's auto-generated documentation includes:

  • A visual diagram of the flows in your application
  • The XML configuration which corresponds to each flow in your application
  • The text you entered in the Notes tab of any building block in your flow

Reviews

Download
Log into Anypoint Platform to download this asset

Overview

Type
Example
Organization
MuleSoft
Created by
MO
MuleSoft Organization
Published onJul 28, 2018

Versions

VersionRuntime version
2.1.34.1.1
2.1.24.1.1
1.4.03.x
1.3.33.7
Show more

Categories

Difficulty
Average
Horizontal Functions
Enterprise IT
Products
Netsuite