Skip to content
Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integrating with NetSuite

You connect NetSuite yourself with token-based authentication (TBA): create an integration and an access token in NetSuite, then enter five values in Drivetrain. Saved searches are optional and need a small script in NetSuite.

Before you start

  • In Drivetrain: you need to be an admin.

  • In NetSuite: a NetSuite administrator does the setup below. The connection itself should use a dedicated integration user with its own role. The Administrator role also works, but Oracle advises against it for web services integrations.

  • Features to enable at Setup > Company > Setup Tasks > Enable Features:

    • SuiteCloud subtab: REST Web Services and Token-based Authentication (under Manage Authentication). For saved searches, also SOAP Web Services, Client SuiteScript and Server SuiteScript.

    • Analytics subtab: SuiteAnalytics Workbook.

  • Permissions for the integration role (Drivetrain only reads data):

Tab
Permission
Level
Needed for

Setup

Log in using Access Tokens

Full

All

Setup

REST Web Services

Full

All

Reports

SuiteAnalytics Workbook

Edit

All

Setup

User Access Tokens

Full

Only if the integration user creates its own token

Setup

SOAP Web Services

Full

Saved searches

Lists

Documents and Files

Full

Saved searches

The role also needs view access to every record Drivetrain syncs (see What data comes in), including each transaction type you plan with (for example journal entries, invoices and bills), consolidated exchange rates, accounting periods and deleted records. If you use subsidiaries or multiple accounting books, give the role All subsidiaries with Allow Cross-Subsidiary Record Viewing, and all accounting books. Integrating with NetSuite (Role Based Access) has a complete role sheet you can copy; it grants more than this minimum, which also works.

Step 1: Set up NetSuite

1. Create the integration user

  • Create the role at Setup > Users/Roles > Manage Roles > New, with the permissions above.

  • Go to Lists > Employees > Employees > New.

  • Select the Standard Employee Form, enter the name "Drivetrain Integration" and a service-account email from your own domain (for example drivetrain@mycompany.com).

  • On the Access subtab, check Give Access, set a password, add the role you created (the screenshot shows Administrator) and click Save.

2. Create an integration

  • Go to Setup > Integration > Manage Integrations > New.

  • Enter a Name (for example "Drivetrain Integration"). Under Authentication, check TOKEN-BASED AUTHENTICATION and uncheck TBA: AUTHORIZATION FLOW. In OAuth 2.0, uncheck AUTHORIZATION CODE GRANT. Click Save.

  • Under Client Credentials at the bottom of the page, copy the Consumer Key and Consumer Secret. NetSuite shows them only once.

3. Create an access token

  • Log in to NetSuite as the integration user and click the Home icon.

  • At the bottom of the Settings list, click Manage Access Tokens, then New My Access Token. The link only appears if Token-based Authentication is enabled and the role has User Access Tokens. An administrator can instead create the token at Setup > Users/Roles > Access Tokens > New.

  • In APPLICATION NAME, select the integration from step 2 and click Save.

  • Copy the Token ID and Token Secret. NetSuite shows them only once.

4. Find your account ID

  • Go to Setup > Company > Company Information and copy the Account ID (for example 1234567, or 1234567_SB1 for a sandbox).

5. Install the saved search script (only for saved searches)

  1. Go to Customization > Scripting > Scripts > New. The Upload Script File form opens.

  1. Hover over the Script File field and click the + button that appears. Pick a folder if you don't want the default (SuiteScripts), click Choose File, select the unzipped file and click Save.

  1. Click Create Script Record. Enter Name "Drivetrain Saved Search" and ID "drivetrainsavedsearch". On the Deployments tab, enter Title "DrivetrainSavedSearch" and set the status to Released. Click Save.

  1. Click the deployment title to open the Script Deployment, and copy the External URL.

  1. Edit the deployment, add the integration user's role to its audience (the screenshot shows Administrator) and click Save.

  1. Go to Documents > Files > File Cabinet > New and add a folder named DrivetrainExports at the root. The script writes each export there.

Step 2: Connect NetSuite in Drivetrain

  1. On the Data page, click the + icon at the top of the Data panel (or Add data source if nothing is connected yet).

  1. Select NetSuite.

  1. Enter Account ID, Consumer key, Consumer secret, Token key (NetSuite's Token ID) and Token secret, and click Connect. Connect stays disabled until every field is filled.

  1. Drivetrain tests the credentials, opens the new NetSuite data source and starts the first sync.

Add a saved search (optional)

Add saved searches after the first sync finishes. Each saved search must be visible to the integration role (for example Public), and you need the External URL from Step 1.5.

  1. On the NetSuite data source, click Add data (it may read Add saved search).

  1. Enter the External URL (if it isn't already filled in), paste the full Saved search URL and enter a Display name. For example, paste https://123456.app.netsuite.com/app/common/search/searchresults.nl?searchid=884&whence=, not just the ID 884.

  1. Click Create. The saved search appears as a dataset once it syncs.

What data comes in

  • Accounts, accounting periods, consolidated exchange rates, currencies, customers, departments, classes, locations, subsidiaries, vendors, items, transactions, transaction lines, transaction accounting lines and deleted records. Drivetrain builds standard NetSuite datasets from them, such as General Ledger and Trial Balance.

  • The first sync pulls all transactions. Later syncs pull only records changed since the last sync.

  • Each saved search is exported in full on every sync.

  • Data syncs daily by default. Use Sync in the data source's menu to sync now, or Sync schedule to change the schedule.

Update credentials or disconnect

  • NetSuite tokens don't expire, but they stop working if they're revoked or the user, role or integration changes. To enter a new token, open the data source's menu, choose Edit credentials, enter the values and click Update credentials. A full sync starts. You can't edit while a sync is running, or switch to a different NetSuite account.

  • To disconnect, choose Remove and confirm. To also cut access on the NetSuite side, revoke the token at Setup > Users/Roles > Access Tokens.

  • Your Drivetrain team may ask for read-only access to the NetSuite UI during onboarding to check numbers. This isn't needed for the connection.

Troubleshooting

"Invalid login credentials. Please check for any errors or confirm that they are still valid"

Drivetrain's test query to NetSuite failed. Check the five values and that the token belongs to this integration and account. Check that REST Web Services, Token-based Authentication and SuiteAnalytics Workbook are enabled, and that the role has Log in using Access Tokens, REST Web Services and SuiteAnalytics Workbook.

"… must be alphanumeric" or "Account ID must be start with a number"

Copy the value again without spaces or line breaks. The account ID starts with digits, for example 1234567 or 1234567_SB1.

Syncs fail and Drivetrain says the credentials are invalid or have been revoked

NetSuite rejected the login ("Invalid login attempt"): the token was revoked, or the user, role or integration changed. Check NetSuite's login audit trail at Setup > Users/Roles > User Management > View Login Audit Trail, create a new token and use Edit credentials.

The sync fails because a record type is "nonexistent" or returns an "invalid search query"

The role can't see that record type, or the feature is off in NetSuite. Give the role View access to it (see Before you start), or enable the feature.

Saved search: "The NetSuite role connected to Drivetrain cannot export saved searches…"

Give the role Documents and Files at Full, and check that the DrivetrainExports folder exists at the root of the File Cabinet.

Saved search: "Drivetrain could not reach the saved search script in NetSuite…"

Check that the script deployment is Released, that the integration role is in its audience, and that the External URL is the deployment's. Client SuiteScript and Server SuiteScript must be enabled.

Saved search: "Invalid URL"

Paste full URLs. The External URL must contain script= and deploy=, and the saved search URL must contain searchid=.

Last updated

Was this helpful?