Netsuite
Overview
Import/clone Netsuite_HTTP source from the Connectors library
application. In the Variables section of the source set value to the
following variables: roleInternalId (aka roleNSkey), appId,
account, email, password.
The connector implementation is based on Netsuite SOAP API (Netsuite also has REST API that we don’t use) and consists of the following scenarios:
-
NetSuite - Load any- an universal scenario that loads any object from NetSuite. This scenario has parameters. Look at “RunScenario: Load netsuite_employee” and “RunScenario: Load netsuite_customer” operations in the “NetSuite” scenario for examples of calling the scenario to load employees and customers respectively. To figure out values of the parameters to load other objects, read the corresponding sections below. -
NetSuitecontains examples of loading data from Netsuite. Example that use Load operation actually executeNetSuite - Load anyscenario as defined in the Objects/operations Mapping section of theNetsuite_HTTPsource. Notice that you can expand each line in the mapping and see parameter values for theNetSuite - Load any. In theNetSuitescenario, you can also find examples of explicitly callingNetSuite - Load any- this is equivalent of using the mapping by calling Load operation. So, for example, “Load: netsuite_employee” and “RunScenario: Load netsuite_employee” do exactly the same thing.
How to set up API access in Netsuite
This connector uses Netsuite SOAP API. To set up SOAP API access, do the following in the Netsuite UI:
-
Create an integration record. When you create an integration record, the system automatically generates an application ID that will be used in API authentication. You can find instructions at Creating an Integration Record . When you create an integration record you enable authentication methods. If you are not sure which authentication method to use, select TOKEN-BASED AUTHENTICATION and USER CREDENTIALS as those two are easier for developers that use the API. After the integration record is created store APPLICATION ID, CLIENT ID, CLIENT SECRET.
-
Find Account ID and Role Internal ID folliwing instructions in Authentication for SOAP Web Services . The role must meet the following requirements: (1) it must be assigned to the user you will use for the “User Credentials” authentication; (2) WEB SERVICES ONLY ROLE must be checked for the role; (3) Permissions -> Setup must include the “SOAP Web Services” permission set to “Full”.
-
As the result of the previous steps you should have the following values that you will need to enter in
Netsuite_HTTPsource in InfoLink:roleInternalId(aka roleNSkey),appId,account. Also enteremail,passwordof an user to which the role is assigned.
How to create a model for the modelName parameter of NetSuite - Load any
Notice that one of the parameters of the NetSuite - Load any scenario
is modelName that is used in the Target mapping script of the both
HTTPRequest operations. The model can only be generate from an example
of response from Netsuite as we have not found any way to get a list of
all object fields (including customer fields) via NetSuite API. As an
example we explain how we created NetsuiteEmployee model used to load
employees. Go to NetSuite scenario - > “RunScenario: Load
netsuite_employee” and click on it. Copy the scenario parameter values
shown in JSON format. Then go to NetSuite - Load any click on the
HTTPRequest: Load first page operation, click on the Test with …
button in the Target section and paste the JSON parameters you copied on
the previous steps. Click the Run button. Look at the result in the
HTTP console and copy a JSON object representing a *single* employee.
Go to Specifications, right click on the Models node and create
a new model. In the model specification, click on the Import columns
from sample button and paste your JSON object representing a single
employee. It will extract all top-level properties from the JSON object
and create corresponding columns. Such import is supposed to be done
once to avoid creating columns manually. You can always add more columns
manually that were missing in this particular employee you copied.
How to find values for the searchCommand and searchField parameters of NetSuite - Load any
Go to the Netsuite API documentation at
https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2017_1/schema/search/issuesearch.html?mode=package .
In the dropdown menu select: platform -> common. Click on the
Search tab. Find the corresponding search type ending with “Basic”
(eg EmployeeSearchBasic). Use it as searchCommand. Then click on it
and find a proper seach field: almost all search types has dataCreated
field but if it is missing then find some other datetime field.
How to find for various types of transactions (eg Sales Order, Invoice, etc)
Many objects in Netsuite (such Sales Order, Invoice, etc) are types of
Transaction. To retrieve such objects set searchCommand to
TransactionSearchBasic and add a filter as follows:
"filter1": "<platform-common:type operator='anyOf' xsi:type='platform-core:SearchEnumMultiSelectField'><platform-core:searchValue xsi:type='xsd:string'>[transaction type]</platform-core:searchValue></platform-common:type>",In the above filter, replace [transaction type] with any value from
the following list Schema Browser -gt; Transactions -gt; sales -gt;
Enum -gt;
TransactionType
How to give permissions to access objects
In case of error INSUFFICIENT_PERMISSION you usually get a message that describes permissions required, for example: “Permission Violation: You need the ‘Lists -> Contact Roles’ permission to access this page.” To give the permission, log in to Netsuite -> select Setup in the menu -> Users/Roles -> Manage Roles -> click on the role -> Permissions tab -> Lists subtab -> Edit button -> add the permission required.