Connectors → NetSuite Saved Searches

About NetSuite Saved Searches

NetSuite helps companies manage key business processes with a single, fully integrated cloud-based system. Some of those processes include enterprise resource planning and financials, CRM, e-commerce, inventory, and more. NetSuite enables users to search for any record type in the system and save this search in the form of a Saved Search.

About the NetSuite Saved Searches Connector

The NetSuite Saved Searches connector supports the following Incorta-specific functionality:

FeatureSupported
Chunking
Data Agent
Encryption at Ingest
Incremental Load
Multi-Source
OAuth
Performance Optimized
Remote
Single-Source
Spark Extraction
Webhook Callbacks

Configure NetSuite Account

Enable Required Features

NetSuite Searches sends requests to NetSuite to extract data. The NetSuite account should allow receiving these requests. To do that, you must enable several features.

  1. Navigate to Setup → Company → Enable Features
  2. Select the SuiteCloud tab.
  3. Select the following checkboxes to enable the indicated features:
    • SuiteScript Client SuiteScript
    • SuiteScript Server SuiteScript
    • SuiteTalk (Web Services) SOAP WEB SERVICES
    • SuiteTalk (Web Services) REST WEB SERVICES
    • Manage Authentication OAuth 2.0

Configure User Roles

  1. Navigate to Setup → User/Roles → Manage Roles.
  2. Choose the role you want to enable the Searches Connector for.
  3. Navigate to Permissions → Setup, and then set the following fields:
PermissionValue
SuiteScriptFull
REST Web ServicesFull
SOAP Web ServicesFull
User Access TokensFull
Access Token ManagementFull
Log in using OAuth 2.0 Access TokensFull
OAuth 2.0 Authorized Applications ManagementFull

Deploy Connector Suite Script

In this section, you will upload and deploy a Suite Script to handle Saved Searches requests the connector sends to NetSuite services.

Upload SuiteScript

  1. Navigate to Customizations → Scripting → Scripts → New.
  2. Under Script File, select New, and then upload the below script.
/**
*@NApiVersion 2.x
*@NScriptType Restlet
*/
define(['N/search'],
function(search) {
// Get a standard NetSuite record
function _get(context) {
const script_version = "1.0";
if (context.searchid == -1) {
return JSON.stringify("script_version:" + script_version);
}
var myTransactionSearch = search.load({
id: context.searchid
});
if (context.metadata == 'true') {
var pagedData = myTransactionSearch.runPaged({
pageSize: 10
});
var results = pagedData.fetch({
index: context.index
});
} else {
var pagedData = myTransactionSearch.runPaged({
pageSize: 1000
});
var results = pagedData.fetch({
index: context.index
});
}
return JSON.stringify(results);
}
return {
get: _get
};
});
;

Deploy the SuiteScript

Activate the script by deploying it so it will be ready to respond to the requests:

  1. Navigate to Customizations → Scripting → Scripts.
  2. Select View on the SuiteScript you just created.
  3. Select the Deploy Script button.
  4. Select the Roles, we have previously configured to access the script.
  5. Select Save.

Obtain Script ID and Deployment ID

In Incorta, to configure the NetSuite Searches connector, you must provide the Script ID and the Deployment ID, which refers to the script you have previously uploaded.

To obtain this information, check the URL field to get the values needed. For example, the Script ID here is 7, and the Deployment ID is 1

Test the Script and Deployment

  1. Select the URL supplied. You should see a JSON response.
  2. Append the following to the URL to be able to see valid search values: &searchid=<VALID_SEARCH_ID>&index=0

Authentication

Create an Integration record to allow Incorta to access the script you have deployed.

  1. Navigate to Setup → Integration → Manage Integrations → New.
  2. Check the following options:
    • AUTHORIZATION CODE GRANT under Authentication → OAuth2.0
    • RESTLETS under Authentication → OAuth2.0
    • REST WEB SERVICES under Authentication → OAuth2.0
    • TBA: AUTHORIZATION FLOW under Authentication → Token-Based Authentication
  3. Make sure to uncheck the following options (unless you need to use the same integration for the NetSuite Analytics Connect Connector):
    • USER CREDENTIALS under Authentication → User Credentials
  4. Enter the REDIRECT URI and CALLBACK URL fields as shown below:
    https://<INCORTA_INSTANCE_HOSTNAME>:443/incorta/service/datasource/oauthRedirect

Your input should be similar to the following screenshot:

  1. Select Save. You must not navigate from the current page as per the displayed warning.
  2. Copy the credentials printed at the bottom of the page..
Warning

Copy the Consumer Key and Consumer Secret to any secret store you trust as we will use this to set up our connector.

Steps to connect NetSuite Saved Searches and Incorta

To connect NetSuite Saved Searches and Incorta, here are the high-level steps, tools, and procedures:

Create an external data source

Here are the steps to create an external data source with the NetSuite Saved Searches connector:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Data.
  • In the Action bar, select + NewAdd Data Source.
  • In the Choose a Data Source dialog, in Application, select NetSuite Saved Searches.
  • In the New Data Source dialog, specify the applicable connector properties.
  • To test, select Test Connection.
  • Select Ok to save your changes.

NetSuite Saved Searches connector properties

Access the NetSuite Saved Searches connector credentials with the following steps:

  • Sign in to NetSuite.
  • Select Set Up Saved Searches Connect, which is located under Settings in the bottom left corner of the screen.
  • On the Saved Searches Connect Driver Download page, select Your Configuration to access the credentials, including Host, Port, and Account ID, and Role ID.

Here are the properties for the NetSuite Saved Searches connector:

PropertyControlDescription
Data Source Nametext boxEnter the name of the data source
Account IDtext boxEnter the NetSuite account ID number
Consumer Keytext boxEnter the NetSuite consumer key you have obtained while setting up the account.
Consumer Secrettext boxEnter the Netsuite consumer secret number.
AuthorizebuttonSelect to authorize Incorta to your Netsuite account.
Authentication Schemedrop downChoose the authentication type you are going to use.
The available options are:
  ●  OAuth 2.0
  ●  Token-based Authentication.
Script IDtoggleEnter the script ID for the SuiteScript uploaded to Netsuite.
Deployment IDdrop-down listEnter the deployment ID for the script provided in Script ID.
Important

The default role for connecting to NetSuite is the full administrator role (RoleID=3). However, it is not required to use a full administrator role and it is often not advisable to use this role, especially in the case of public companies and/or security audits that track full administrator access to NetSuite. An alternative is to create a custom administrator role that has only view privileges to all of the tables imported into Incorta. In this case, the custom administrator Role ID is substituted above. Before creating a custom role, it is important to consider whether you need full access to the Netsuite tables, as certain tables, such as metadata tables, are not accessible with a custom administrator role.

Create a schema with the Schema Wizard

Here are the steps to create a NetSuite Saved Searches schema with the Schema Wizard:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the Action bar, select + New → Schema Wizard.
  • In (1) Choose a Source, specify the following:
  • For Enter a name, enter the schema name.
  • For Select a Datasource, select the NetSuite Saved Searches external data source.
  • Optionally create a description.
  • In the Schema Wizard footer, select Next.
  • In (2) Manage Tables, in the Data Panel, first select the name of the Data Source, and then check the Select All checkbox.
  • In the Schema Wizard footer, select Next.
  • In (3) Finalize, in the Schema Wizard footer, select Create Schema.

Create a schema with the Schema Designer

Here are the steps to create a NetSuite Saved Searches schema using the Schema Designer:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the Action bar, select + NewCreate Schema.
  • In Name, specify the schema name, and select Save.
  • In Start adding tables to your schema, select SQL Database.
  • In the Data Source dialog, specify the NetSuite Saved Searches table data source properties.
  • Select Add.
  • In the Table Editor, in the Table Summary section, enter the table name.
  • To save your changes, select Done in the Action bar.

NetSuite Saved Searches table data source properties

For a schema table in Incorta, you can define the following NetSuite Saved Searches-specific data source properties as follows:

PropertyControlDescription
Typedrop down listThe default is SQL Database.
Data Sourcedrop-down listSelect the NetSuite Saved Searches external data source
IncrementaltoggleEnable the incremental load configuration for the schema table.
Fetch Sizetext boxFor performance improvement, define the number of records that will be retrieved from the database in each batch until all records are retrieved. The default is 5000.
Querytext boxEnter the query to retrieve data from NetSuite Saved Searches
Update Querytext boxEnable Incremental to configure this property. Define the SQL update query to use during an incremental load. The query and update query should be of the same structure, that is, the same selected columns.
Chunking Methoddrop-down listChunking methods allow for parallel extraction of large tables. The default is No Chunking. There are two chunking methods: By Size of Chunking (Single Table) By Date/Timestamp
Chunk Sizetext boxSelect By Size of Chunking for the Chunking Method to set this property. Enter the number of records to extract in each chunk in relation to the Fetch Size. The default is 3 times the Fetch Size.
Order Columndrop down listSelect By Size of Chunking for the Chunking Method to set this property. Select a column in the source table you want to order by before chunking. It's typically an ID column and it must be numeric.
Upper Bound for Order Columntext boxOptional. Enter the maximum value for the order column.
Lower Bound for Order Columntext boxOptional. Enter the minimum value for the order column.
Order Column [Date/Timestamp]drop down listSelect By Date/Timestamp for the Chunking Method to set this property. Select a column in the source table you want to order by before chunking. It should be a Date/Timestamp column.
Chunk Perioddrop down listSelect the chunk period that will be used in dividing chunks:
  ●   Daily
  ●   Weekly (default)
  ●  Monthly
  ●  Yearly
  ●  Custom
Number of daystext boxSelect Custom for the Chunk Period to set this property. Enter the chunking period in days

View the schema diagram with the Schema Diagram Viewer

Here are the steps to view the schema diagram using the Schema Diagram Viewer:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the list of schemas, select the NetSuite Saved Searches schema.
  • In the Schema Designer, in the Action bar, select Diagram.

Load the schema

Here are the steps to perform a Full Load of the NetSuite Saved Searches schema using the Schema Designer:

  • Sign in to the Incorta Direct Data Platform.
  • In the Navigation bar, select Schema.
  • In the list of schemas, select the NetSuite Saved Searches schema.
  • In the Schema Designer, in the Action bar, select Load → Load Now → Full.
  • To review the load status, in Last Load Status, select the date.

Explore the schema

With the full load of the NetSuite Saved Searches schema complete, you can use the Analyzer to explore the schema, create your first insight, and save the insight to a new dashboard.

To open the Analyzer from the schema, follow these steps:

  • In the Navigation bar, select Schema.
  • In the Schema Manager, in the List view, select the NetSuite Saved Searches schema.
  • In the Schema Designer, in the Action bar, select Explore Data.