# mulesoft NetSuite Restlet Connector - Full Documentation --- product: NetSuite Restlet Connector version: 1.0 is-latest-version: true --- # Call NetSuite RESTlets Example > For the full documentation index, see: https://docs.mulesoft.com/llms.txt This example shows how to: - Create a script that calls NetSuite RESTlets that are deployed in NetSuite instances to create, retrieve, and delete a customer record - Deploy the RESTlet script - Configure the application’s properties to connect to NetSuite and deploy the app ## Create and Deploy a Script as a RESTlet Create and then deploy a script that creates, retrieves, and deletes a customer record: 1. Create a sample JavaScript script: ```javascript // Get a standard NetSuite record function getRecord(datain) { return nlapiLoadRecord(datain.recordtype, datain.id); // for example, recordtype="customer", id="769" } // Create a standard NetSuite record function createRecord(datain) { var err = new Object(); // Validate if mandatory record type is set in the request if (!datain.recordtype) { err.status = "failed"; err.message = "missing recordtype"; return err; } var record = nlapiCreateRecord(datain.recordtype); for (var fieldname in datain) { if (datain.hasOwnProperty(fieldname)) { if (fieldname != "recordtype" && fieldname != "id") { var value = datain[fieldname]; if (value && typeof value != "object") // ignore other type of parameters { record.setFieldValue(fieldname, value); } } } } var recordId = nlapiSubmitRecord(record); nlapiLogExecution("DEBUG", "id=" + recordId); var nlobj = nlapiLoadRecord(datain.recordtype, recordId); return nlobj; } // Delete a standard NetSuite record function deleteRecord(datain) { nlapiDeleteRecord(datain.recordtype, datain.id); // for example: recordtype="customer", id="769" } ``` 2. Enable SuiteScript and NetSuite Web Services in your account: 1. Log in to NetSuite. 2. Click **Set Up > Company > Enable Features > SuiteCloud**: ![Enable SuiteScript page](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-enable-suitescript.png) 3. Upload the file you [previously created](#deploy-a-script-as-restlet): 1. Go to **Customization > Scripting > Scripts > New**. 2. Select the script file, click **Create Script Record**, and select **RESTlet**: ![Select Script Type page](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-script-type.png) 4. Complete the form using the content of the script you uploaded, and deploy the script: ![Setup Script page](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-setup-script.png) 5. Select your audience to view the following page: ![Script Deployment page](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-script-deployment.png) 6. Write down the script and deploy numbers that appear in the external URL, because you need them to call the RESTlet later. ## Create a Mule Project In Studio, create a new Mule project and configure the credentials, deployed script, and deploy IDs to connect to NetSuite: 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. 3. In **Package Explorer**, open the `src/main/resources/mule-app.properties` file that is located in the Studio project you created. 4. Configure the following values: ```javascript netsuite.email= netsuite.password= netsuite.account= netsuite.roleId= netsuite.applicationId= netsuite.subsidiary= netsuite.script= netsuite.deploy= ``` The `netsuite.script` and `netsuite.deploy` values are the values you wrote down in the last step of [Create and Deploy a Script as a RESTlet](#deploy-a-script-as-restlet). ## Add the Connector to Your Mule Project Add NetSuite Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file: 1. In the **Mule Palette** view, click **(X) Search in Exchange**. 2. In **Add Modules to Project**, type `netsuite` in the search field. 3. Click the connector name in **Available modules**. 4. Click **Add**. 5. Click **Finish**. ## Create the App Flow 1. In the Studio canvas, click **Configuration XML**. 2. Delete all the contents after the line ``. 3. Copy and paste the following XML after the line ``: ```xml ``` 4. Save the project. ### About the Flows 1. The `html-form` flow renders the HTML form with a `parseTemplate` component: ![HMTL Form Studio flow](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-html-form-flow.png) 2. The `restletGet` flow calls the GET function of a RESTlet: ![Restlet Get Studio flow](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-restlet-get.png) 3. The `restletPost` flow calls the POST function of a RESTlet: ![Restlet Post Studio flow](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-restlet-post.png) 4. The `restletDelete` flow calls the DELETE function of a RESTlet: ![Restlet Delete Studio flow](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-restlet-delete.png) ## Run the App Run, deploy, and verify the app: 1. Click **Global Elements** at the base of the project’s canvas. 2. In **Global Configuration Elements**, select **NetSuite Rest config** and click **Edit**. 3. Click **Test Connection** to ensure there is connectivity with the sandbox. A success message appears: ![Test connection successful message](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-demo-connection-test.png) 4. Click the project name in **Package Explorer** and click **Run > Run As > Mule Application**. In the console, look for the message `Mule is up and kicking` to verify that the application started successfully. 5. Open a browser and access the URL `http://localhost:8081`. You can see that the application deployed: ![Demo page](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-demo-main-page.png) ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [NetSuite Connector Overview](https://docs.mulesoft.com/netsuite-restlet-connector/latest/) - [NetSuite Connector Reference](https://docs.mulesoft.com/netsuite-restlet-connector/latest/netsuite-restlet-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: NetSuite Restlet Connector version: 1.0 is-latest-version: true --- # NetSuite Restlet - XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio. When you install the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file. If you manually code a Mule runtime engine (Mule) app in XML either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `mule` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/netsuite-restlet http://www.mulesoft.org/schema/mule/netsuite-restlet/current/mule-netsuite-restlet.xsd ``` This example shows how the namespace statements are placed in the XML: ```xml ``` ## Add a POM File Dependency The `pom.xml` Apache Maven file generated by Anypoint Studio contains dependencies for a Mule app. When you code a Mule app manually, include this XML snippet in your POM file to enable access to this connector: ```xml com.mulesoft.connectors mule4-netsuite-restlet-connector 1.0.0 mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `netsuite restlet`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## Next Step After completing your namespace and `pom.xml` file, you can try the [Call NetSuite Restlets Example](https://docs.mulesoft.com/netsuite-restlet-connector/latest/netsuite-restlet-call-restlets-example). ## See Also [Salesforce Help](https://help.salesforce.com) --- product: NetSuite Restlet Connector version: 1.0 is-latest-version: true --- # NetSuite Restlet Connector 1.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for NetSuite Restlet (NetSuite Restlet Connector) synchronizes data and automates business processes between NetSuite and third-party applications, either on-premises or in the cloud. NetSuite provides cloud-based business management software that helps companies manage core business processes, ERP financials, CRM, e-commerce, inventory, and more. NetSuite Restlet Connector provides the following features: - Generation of NetSuite business objects - Different authentication levels - Error-handling support - Access to NetSuite using REST calls to RESTlets that expose APIs created with SuiteScript For compatibility information and fixed issues, see the NetSuite Restlet Connector Release Notes. ## Before You Begin To use this connector, you must be familiar with: - The NetSuite API - Anypoint connectors - Mule runtime engine (Mule) - Elements in a Mule flow - Global elements - How to create a Mule app using Anypoint Studio You must also have a NetSuite account with the Web Services features enabled. ## Connection Types > [!NOTE] NetSuite Restlet Connector supports OAuth 1.0 only. NetSuite Restlet connections use the following authentication types: - Restlet Login Authenticates to NetSuite by invoking login - Restlet Token Authenticates to NetSuite by using either a consumer and token key or secret pairs, which are established within the NetSuite environment For information about configuring authentication types, refer to [Configure a Global Element for the Connector](https://docs.mulesoft.com/netsuite-restlet-connector/latest/netsuite-restlet-studio-configure#configure-global-element). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [NetSuite Restlet Reference](https://docs.mulesoft.com/netsuite-restlet-connector/latest/netsuite-restlet-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: NetSuite Restlet Connector version: 1.0 is-latest-version: true --- # NetSuite Restlet Connector 1.0 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for NetSuite Restlet (NetSuite Restlet Connector) synchronizes data and automates business processes between NetSuite and third party applications, either on-premises or in the cloud. ## Rest Configuration
NameTypeDescriptionDefault ValueRequired

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types that can be provided to this configuration.

x

Name

String

The identifier of this element used to reference it in other components

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. Mule purges the instances as appropriate.

## Connection Types > [!NOTE] NetSuite Restlet Connector supports OAuth 1.0 only. ### Restlet Login
NameTypeDescriptionDefault ValueRequired

Web Service Endpoint

String

The Web Service endpoint.

Read Timeout

Number

Specifies the amount of time that the client will wait for a response before it times out.

60000

Read Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Read Timeout parameter.

MILLISECONDS

Connection Timeout

Number

Specifies the amount of time in milliseconds that the client attempts to establish a connection before it times out. 0 specifies that the client continues to attempt to open a connection indefinitely.

60000

Connection Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The time unit for Connection Timeout.

MILLISECONDS

TLS configuration

Defines a configuration for TLS, which can be used from both the client and server sides to secure communication for the Mule app. When using the HTTPS protocol, the HTTP communication is secured using TLS or SSL. If HTTPS is configured as the protocol then the user needs to configure at least the keystore in the tls:context child element of the listener-config.

Host

String

Hostname of the HTTP proxy, for example localhost. If used, you must also set the Port value.

Port

Number

The port number of the HTTP proxy, for example 3128. The port number must be specified if the Hostname is also specified.

Username

String

The username which should be supplied to the HTTP proxy on every request to NetSuite. This field is optional, since a user might want to pass through an unauthenticated HTTP proxy.

Password

String

The password which would be supplied to the HTTP proxy on every request to NetSuite. This field is optional, since a user might want to pass through an unauthenticated HTTP proxy.

E-mail

String

The login email of both NetSuite UI and SuiteTalk

x

Password

String

The login password of both the NetSuite UI and SuiteTalk

x

Account

String

NetSuite SuiteTalk WebService account ID

x

Role ID

String

The ID of the role used to login in SuiteTalk, which determines the Processor privileges

x

Application ID

String

The ID related to the Integration record to be used. Integration records are set up on the NetSuite environment.

x

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Pooling Profile

Characteristics of the connection pool

### Restlet Token
NameTypeDescriptionDefault ValueRequired

Web Service Endpoint

String

The Web Service endpoint.

Read Timeout

Number

Specifies the amount of time that the client will wait for a response before it times out.

60000

Read Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The time unit for Read Timeout.

MILLISECONDS

Connection Timeout

Number

Specifies the amount of time that the client attempts to establish a connection before it times out. 0 specifies that the client will continue to attempt to open a connection indefinitely.

60000

Connection Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The time unit for Connection Timeout.

MILLISECONDS

TLS configuration

Defines a configuration for TLS, which can be used from both the client and server sides to secure communication for the Mule app. When using the HTTPS protocol, the HTTP communication is secured using TLS or SSL. If HTTPS is configured as the protocol then the user needs to configure at least the keystore in the tls:context child element of the listener-config.

Host

String

Hostname of the HTTP proxy, for example localhost. If used, you must also set the Port value.

Port

Number

The port number of the HTTP proxy, for example 3128. The port number must be specified if the Hostname is also specified.

Username

String

Username that is supplied to the HTTP proxy upon every request to NetSuite. This field is optional, since a user might want to pass through an unauthenticated HTTP proxy.

Password

String

Password that is supplied to the HTTP proxy upon every request to NetSuite. This field is optional, since a user might want to pass through an unauthenticated HTTP proxy.

Consumer Key

String

Consumer key value for the token based authentication-enabled integration record that is being used.

x

Consumer Secret

String

Consumer secret value for the token based authentication-enabled integration record that is being used.

x

Token ID

String

Token ID that represents the unique combination of a user and integration generated within the NetSuite environment.

x

Token Secret

String

The respective token secret for the user/integration pair.

x

Account

String

NetSuite SuiteTalk WebService account ID.

x

Signature Algorithm

String

Algorithm used to compute the SHA hash signature.

HMAC_SHA_256

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Pooling Profile

Characteristics of the connection pool.

#### Associated Operations - [Call RESTlet (DELETE)](#CallRestletDelete) - [Call RESTlet (GET)](#CallRestletGet) - [Call RESTlet (POST)](#CallRestletPost) - [Call RESTlet (PUT)](#CallRestletPut) ## Operations ## Call RESTlet (DELETE) `` Calls a NetSuite RESTlet using the DELETE method. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Script

Number

The ID of the deployed script.

x

Deploy

Number

The deploy number corresponding to the script.

x

Data

Object

The input data for the script.

#[payload]

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component

x

Reconnection Strategy

A retry strategy in case of connectivity errors

### For Configurations - [Rest Configuration](#RestConfig) ### Throws - NETSUITE-RESTLET:CONNECTIVITY - NETSUITE-RESTLET:ERROR\_FAULT - NETSUITE-RESTLET:MAPPING\_ERROR - NETSUITE-RESTLET:PARSING\_ERROR - NETSUITE-RESTLET:RETRY\_EXHAUSTED ## Call RESTlet (GET) `` Calls a NetSuite RESTlet using the GET method. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Script

Number

The ID of the deployed script.

x

Deploy

Number

The deploy number corresponding to the script.

x

Data

Object

The input data for the script.

#[payload]

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

### Output

Type

Array of Object

### For Configurations - [Rest Configuration](#RestConfig) ### Throws - NETSUITE-RESTLET:CONNECTIVITY - NETSUITE-RESTLET:ERROR\_FAULT - NETSUITE-RESTLET:MAPPING\_ERROR - NETSUITE-RESTLET:PARSING\_ERROR - NETSUITE-RESTLET:RETRY\_EXHAUSTED ## Call RESTlet (POST) `` Calls a NetSuite RESTlet using the POST method. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Script

Number

The ID of the deployed script.

x

Deploy

Number

The deploy number corresponding to the script.

x

Data

Object

The input data for the script.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to be used to execute this component

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

### Output

Type

Array of Object

### For Configurations - [Rest Configuration](#RestConfig) ### Throws - NETSUITE-RESTLET:CONNECTIVITY - NETSUITE-RESTLET:ERROR\_FAULT - NETSUITE-RESTLET:MAPPING\_ERROR - NETSUITE-RESTLET:PARSING\_ERROR - NETSUITE-RESTLET:RETRY\_EXHAUSTED ## Call RESTlet (PUT) `` Calls a NetSuite RESTlet using the PUT method. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Script

Number

The ID of the deployed script.

x

Deploy

Number

The deploy number corresponding to the script.

x

Data

Object

The input data for the script.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to be used to execute this component

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

### Output

Type

Array of Object

### For Configurations - [Rest Configuration](#RestConfig) ### Throws - NETSUITE-RESTLET:CONNECTIVITY - NETSUITE-RESTLET:ERROR\_FAULT - NETSUITE-RESTLET:MAPPING\_ERROR - NETSUITE-RESTLET:PARSING\_ERROR - NETSUITE-RESTLET:RETRY\_EXHAUSTED ## Types ### TLS
FieldTypeDescriptionDefault ValueRequired

Enabled Protocols

String

A comma separated list of protocols enabled for this context.

Enabled Cipher Suites

String

A comma separated list of cipher suites enabled for this context.

Trust Store

Key Store

Revocation Check

### Trust Store
FieldTypeDescriptionDefault ValueRequired

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the trust store.

Password

String

The password used to protect the trust store.

Type

String

The type of store used.

Algorithm

String

The algorithm used by the trust store.

Insecure

Boolean

If true, no certificate validations will be performed, rendering connections vulnerable to attacks. Use at your own risk.

### Key Store
FieldTypeDescriptionDefault ValueRequired

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the key store.

Type

String

The type of store used.

Alias

String

When the key store contains many private keys, this attribute indicates the alias of the key that should be used. If not defined, the first key in the file will be used by default.

Key Password

String

The password used to protect the private key.

Password

String

The password used to protect the key store.

Algorithm

String

The algorithm used by the key store.

### Standard Revocation Check
FieldTypeDescriptionDefault ValueRequired

Only End Entities

Boolean

Only verify the last element of the certificate chain.

Prefer Crls

Boolean

Try CRL instead of OCSP first.

No Fallback

Boolean

Do not use the secondary checking method (the one not selected before).

Soft Fail

Boolean

Avoid verification failure when the revocation server can not be reached or is busy.

### Custom OCSP Responder
FieldTypeDescriptionDefault ValueRequired

Url

String

The URL of the OCSP responder.

Cert Alias

String

Alias of the signing certificate for the OCSP response (must be in the trust store), if present.

### CRL File
FieldTypeDescriptionDefault ValueRequired

Path

String

The path to the CRL file.

### Reconnection
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

The reconnection strategy to use

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often (in ms) to reconnect

Blocking

Boolean

If false, the reconnection strategy will run in a separate, non-blocking thread

Count

Number

How many reconnection attempts to make

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often (in ms) to reconnect

Blocking

Boolean

If false, the reconnection strategy will run in a separate, non-blocking thread

### Pooling Profile
FieldTypeDescriptionDefault ValueRequired

Max Active

Number

Controls the maximum number of Mule components that can be borrowed from a session at one time. When set to a negative value, there is no limit to the number of components that may be active at one time. When maxActive is exceeded, the pool is said to be exhausted.

Max Idle

Number

Controls the maximum number of Mule components that can sit idle in the pool at any time. When set to a negative value, there is no limit to the number of Mule components that may be idle at one time.

Max Wait

Number

Specifies the number of milliseconds to wait for a pooled component to become available when the pool is exhausted and the exhaustedAction is set to WHEN_EXHAUSTED_WAIT.

Min Eviction Millis

Number

Determines the minimum amount of time an object may sit idle in the pool before it is eligible for eviction. When non-positive, no objects will be evicted from the pool due to idle time alone.

Eviction Check Interval Millis

Number

Specifies the number of milliseconds between runs of the object evictor. When non-positive, no object evictor is executed.

Exhausted Action

Enumeration, one of:

  • WHEN_EXHAUSTED_GROW

  • WHEN_EXHAUSTED_WAIT

  • WHEN_EXHAUSTED_FAIL

Specifies the behavior of the Mule component pool when the pool is exhausted. Possible values are: "WHEN_EXHAUSTED_FAIL", which will throw a NoSuchElementException, "WHEN_EXHAUSTED_WAIT", which will block by invoking Object.wait(long) until a new or idle object is available, or WHEN_EXHAUSTED_GROW, which will create a new Mule instance and return it, essentially making maxActive meaningless. If a positive maxWait value is supplied, it will block for at most that many milliseconds, after which a NoSuchElementException will be thrown. If maxThreadWait is a negative value, it will block indefinitely.

Initialisation Policy

Enumeration, one of:

  • INITIALISE_NONE

  • INITIALISE_ONE

  • INITIALISE_ALL

Determines how components in a pool should be initialized. The possible values are: INITIALISE_NONE (will not load any components into the pool on startup), INITIALISE_ONE (will load one initial component into the pool on startup), or INITIALISE_ALL (will load all components in the pool on startup)

Disabled

Boolean

Whether pooling should be disabled

### Expiration Policy
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A time unit that qualifies the maxIdleTime attribute

## See Also - [Salesforce Help](https://help.salesforce.com) --- product: NetSuite Restlet Connector version: 1.0 is-latest-version: true --- # Troubleshooting NetSuite Restlet Connector > For the full documentation index, see: https://docs.mulesoft.com/llms.txt You might encounter the following issues when working with the Anypoint Connector for NetSuite Restlet (NetSuite Restlet Connector): - [Connectivity test failure during application startup.](#connectivity-test-failure) - [The connector returns a permissions error when fetching metadata.](#permissions-error) ## Connectivity Test Failure During Application Startup If a connectivity test fails during application startup and you see the following statement in the stack trace, configure a reconnection strategy for the connector: ```xml Caused by: java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:998) ~[?:1.8.0_221] ``` To configure a reconnection strategy for the connector in Anypoint Studio (Studio), add these lines to the **Configure XML** tab in the connector properties window: ```xml ``` For example, the configuration XML for the connector might look like this after you add the reconnection strategy: ```xml ``` In Studio, you can also use the **Advanced** tab in the connector properties window to configure a reconnection strategy. To do so, complete the following fields:
FieldValue

Reconnection strategy

Standard

Frequency (ms)

5

Reconnection Attempts

2

## Permissions Error When Fetching Metadata To avoid receiving a permissions error when fetching metadata, enable the `Control SuiteScript and Workflow Triggers in Web Services Request` option in NetSuite for the role used in the connector configuration. ## Inability to Search for Certain Types of Objects There is a limitation in NetSuite’s SuiteTalk API, that prevents you from searching for certain types of objects, such as Sales Order objects. Because of this limitation, you can’t use the NetSuite Connector `Search` operation to locate these objects. To perform a search for Sales Order objects and other unsupported objects, you can do the following: - Develop a SuiteScript, deploy it as a RESTlet, and call it from the connector. ## Empty Payload in the Call RESTlet (GET) Operation Even though the **Call RESTlet (GET)** operation is a GET operation, you must specify a payload for the **Data** field or else the connector throws an error. You can specify an empty payload, such as `{}`, to avoid this error. ## See Also - [Salesforce Help](https://help.salesforce.com) - [Known Issues](https://help.salesforce.com/s/issues) --- product: NetSuite Restlet Connector version: 1.0 is-latest-version: true --- # Using Anypoint Studio to Configure NetSuite Restlet Connector > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure an input source for the connector’s flow](#configure-input-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). If you are new to configuring connectors in Studio, see [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see [NetSuite Restlet Reference](https://docs.mulesoft.com/netsuite-restlet-connector/latest/netsuite-restlet-connector-reference). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure the connector: 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add NetSuite Restlet Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file: 1. In the **Mule Palette** view, click **(X) Search in Exchange**. 2. In **Add Modules to Project**, type `netsuite restlet` in the search field. 3. Click the connector name in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure an Input Source An input source initiates a flow when a specified condition is met. You can configure one of these input sources to use with NetSuite Restlet Connector: - `HTTP Listener`, which initiates a flow each time it receives a request on the configured host and port - `Scheduler`, which initiates a flow when a time-based condition is met For example, to configure HTTP Listener, follow these steps: 1. In the **Mule Palette** view, select **HTTP > Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (+) next to the **Connector configuration** field to configure a global element that can be used by all instances of `HTTP Listener` in the app. 6. On the **General** tab, specify connection information. 7. On the **TLS** tab, optionally specify TLS information. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specific server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform. To add an operation for NetSuite Restlet, follow these steps: 1. In the **Mule Palette** view, select **NetSuite Restlet** and then select the desired operation. 2. Drag the operation onto the Studio canvas to the right of the input source. ## Configure a Global Element for the Connector When you configure a connector, it’s best to configure a global element that all instances of that connector in the app can use. Configuring a global element requires you to provide the authentication credentials the connector uses to access the target NetSuite system. To configure the global element for NetSuite Restlet Connector, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the configuration screen for the operation, click the plus sign (+) next to the **Connector configuration** field to access the global element configuration fields. 3. On the **General** tab, select an authentication mechanism and configure it as described: > [!NOTE] NetSuite Restlet Connector supports OAuth 1.0 only. - [Request-Based Authentication](#restlet-login-authentication) - [Token Authentication](#restlet-token-authentication) > [!NOTE] To configure NetSuite authentication, you must have the account ID for SuiteTalk > NetSuite Web Services, which you can find within the NetSuite sandbox UI under **Setup > > Integration > Web Service Preferences**. 4. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 5. Click **Test Connection** to confirm that Mule can connect with the specified server. 6. Click **OK**. ### Restlet Login Authentication Use this strategy to authenticate to NetSuite by invoking login. ![Request based authentication global elements properties window](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-request-studio.png) -
ParameterDescription

Name

Name for the configuration to reference in subsequent configurations of NetSuite Restlet Connector instances

Email

Email used to log in to the NetSuite UI

Password

Corresponding password to log in to the NetSuite UI

Account

Account ID for SuiteTalk NetSuite Web Services

Role Id

Role ID for the user in SuiteTalk, which determines the processor privileges

Application Id

Application ID corresponding to the integration record to use

### Restlet Token Authentication This token-based authentication method uses either a consumer and token key or secret pairs, which are established within the NetSuite environment: ![Token authentication global elements properties window](/mulesoft/current/en-us/netsuite-restlet-connector/latest/_images/netsuite-token-studio.png) -
ParameterDescription

Consumer Key

Consumer key value for the token-based authentication-enabled integration record to use

Consumer Secret

Consumer secret value for the token-based authentication-enabled integration record to use

Token ID

Token ID that represents the unique combination of a user and an integration record that is generated within the NetSuite environment

Token Secret

Respective token secret for the user and an integration record pair

Account

Account ID for SuiteTalk NetSuite Web Services

Signature algorithm

Type of HMAC signature algorithm

## Next Steps After configuring Studio, see the [Call NetSuite RESTlets Example](https://docs.mulesoft.com/netsuite-restlet-connector/latest/netsuite-restlet-call-restlets-example) topic for more configuration ideas. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [NetSuite Restlet Connector Overview](https://docs.mulesoft.com/netsuite-restlet-connector/latest/) - [NetSuite Connector Reference](https://docs.mulesoft.com/netsuite-restlet-connector/latest/netsuite-restlet-connector-reference) - [Salesforce Help](https://help.salesforce.com)