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:
Feature | Supported |
---|---|
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.
- Navigate to Setup → Company → Enable Features
- Select the SuiteCloud tab.
- 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
- Navigate to Setup → User/Roles → Manage Roles.
- Choose the role you want to enable the Searches Connector for.
- Navigate to Permissions → Setup, and then set the following fields:
Permission | Value |
---|---|
SuiteScript | Full |
REST Web Services | Full |
SOAP Web Services | Full |
User Access Tokens | Full |
Access Token Management | Full |
Log in using OAuth 2.0 Access Tokens | Full |
OAuth 2.0 Authorized Applications Management | Full |
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
- Navigate to Customizations → Scripting → Scripts → New.
- 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 recordfunction _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:
- Navigate to Customizations → Scripting → Scripts.
- Select View on the SuiteScript you just created.
- Select the Deploy Script button.
- Select the Roles, we have previously configured to access the script.
- 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
- Select the URL supplied. You should see a JSON response.
- 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.
- Navigate to Setup → Integration → Manage Integrations → New.
- 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
- 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
- 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:
- Select Save. You must not navigate from the current page as per the displayed warning.
- Copy the credentials printed at the bottom of the page..
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
- Create a schema with the Schema Wizard
- or, Create a schema with the Schema Designer
- Load the schema
- Explore the schema
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 + New → Add 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:
Property | Control | Description |
---|---|---|
Data Source Name | text box | Enter the name of the data source |
Account ID | text box | Enter the NetSuite account ID number |
Consumer Key | text box | Enter the NetSuite consumer key you have obtained while setting up the account. |
Consumer Secret | text box | Enter the Netsuite consumer secret number. |
Authorize | button | Select to authorize Incorta to your Netsuite account. |
Authentication Scheme | drop down | Choose the authentication type you are going to use. The available options are: ● OAuth 2.0 ● Token-based Authentication. |
Script ID | toggle | Enter the script ID for the SuiteScript uploaded to Netsuite. |
Deployment ID | drop-down list | Enter the deployment ID for the script provided in Script ID. |
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 + New → Create 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:
Property | Control | Description |
---|---|---|
Type | drop down list | The default is SQL Database. |
Data Source | drop-down list | Select the NetSuite Saved Searches external data source |
Incremental | toggle | Enable the incremental load configuration for the schema table. |
Fetch Size | text box | For 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. |
Query | text box | Enter the query to retrieve data from NetSuite Saved Searches |
Update Query | text box | Enable 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 Method | drop-down list | Chunking 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 Size | text box | Select 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 Column | drop down list | Select 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 Column | text box | Optional. Enter the maximum value for the order column. |
Lower Bound for Order Column | text box | Optional. Enter the minimum value for the order column. |
Order Column [Date/Timestamp] | drop down list | Select 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 Period | drop down list | Select the chunk period that will be used in dividing chunks: ● Daily ● Weekly (default) ● Monthly ● Yearly ● Custom |
Number of days | text box | Select 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.