> For the complete documentation index, see [llms.txt](https://integrations.drivetrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrations.drivetrain.ai/integration-guide/integrate-with-drivetrain/others/integrating-with-netsuite-role-based-access.md).

# Integrating with NetSuite (Role Based Access)

[<mark style="color:purple;">Prerequisites</mark>](#prerequisites)

[<mark style="color:purple;">NetSuite Setup</mark>](#netsuite-setup)\
[<mark style="color:purple;">Step 1: Create a New Role</mark>](#step-1-create-a-new-role)\
[<mark style="color:purple;">Step 2: Assign Relevant Permissions</mark>](#step-2-assign-relevant-permissions)\
[<mark style="color:purple;">Step 3: Create a User and assign the above Role to that User</mark>](#step-3-create-a-user-and-assign-the-above-role-to-that-user)\
[<mark style="color:purple;">Step 4: Create an Integration</mark>](#step-4-create-an-integration)\
[<mark style="color:purple;">Step 5: Generate the Token Key and Token Secret</mark>](#step-5-generate-the-token-key-and-token-secret)\
[<mark style="color:purple;">Step 6: Get Account ID</mark>](#step-6-get-account-id)\
[<mark style="color:purple;">Step 7: Set up NetSuite Saved Search</mark>](#step-7-set-up-netsuite-saved-search)

[<mark style="color:purple;">Drivetrain Setup</mark>](#step-7-set-up-netsuite-saved-search)\
[<mark style="color:purple;">Step 1: Navigating to the NetSuite connector</mark>](#step-1-navigating-to-the-netsuite-connector)\
[<mark style="color:purple;">Step 2: Entering Credentials</mark>](#step-2-entering-credentials)

### Prerequisites

To connect NetSuite to Drivetrain, you need:

* An active Oracle NetSuite account
* Allowed access to all Account permissions options on the Netsuite account
* Admin privileges in Drivetrain

### NetSuite Setup

{% hint style="info" %}
To integrate NetSuite with Drivetrain, please share the below information with your Drivetrain customer success manager:

* Username and password of NetSuite account with frontend access
* Consumer key and secret of the integration account
* Account ID of the integration account
* Token key and secret of the integration guide
* Script ID and deploy ID after deploying the saved search script

Follow the steps below to get this information.
{% endhint %}

#### **Step 1: Create a New Role**

* Sign in to your NetSuite instance. Make sure you are logged in as an Administrator.
* From the menu bar, navigate to **Setup** > **User/Roles** > **Manage Roles** > **New.**

![](https://lh3.googleusercontent.com/DrQRKqywYB4mhn4EVF_3SgvGs9J_sTNgYsfBuNOdZ7TTNIEjtrn59ltzypE6qV2ozWaNqV4-usFsacl20T4xc1svfx35nm07b-SvnxyaO5nVKV2a1KVF-_NFrkR9HzRc3gULIT45Dg9PFfumow)

* In the Role page, fill in a name for the Role, ensure that *Accounting Center* is selected as '**CENTER TYPE'** and click **Save.**

{% hint style="info" %}
*The "Name" field is a field for your reference. We recommend using "<mark style="color:green;">DrivetrainIntegrationRole</mark>"*
{% endhint %}

![](https://lh4.googleusercontent.com/YS2Nxl7IFRqP3tJGMzXKYm4ShJgT27mMzN_L5xmFXmtHm1XV8HKYZItut6ZSWq8k6F6mfMThsgE1SX8eEzgqNnvL41bMBUdTmxO-yOK8yW3zb2gId-579wSt8zdvaJrSAx_7zwAp1Tv0RrUSmA)

* In case you have subsidiaries enabled, please select '**ALL'** subsidiaries and '**ALLOW CROSS SUBSIDIARY RECORD VIEWING'.**

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FpSoVhik3AzLqbs6upK31%2FNetsuite%201.png?alt=media&#x26;token=8da95172-7789-41cc-9e99-6303b2627d69" alt=""><figcaption></figcaption></figure>

* Please select **ALL** Accounting Books.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FoS7H5TN06kz7VZNJfROh%2FNetsuite%202.png?alt=media&#x26;token=07f461bf-df6e-4530-a186-e8afd9c094b7" alt=""><figcaption></figcaption></figure>

#### Step 2: Assign Relevant Permissions

* Now you'll add permissions for the Role as per the **List of Permissions with Levels** given below. The exact list may vary depending on the fields required for metric calculations specific to your use cases.
  * Transactions and Lists fields require 'View' permission.
  * Reports fields require 'View' permission. However, Report Customization requires 'Full' access.
  * Setup fields requires 'Full' access.

{% embed url="<https://docs.google.com/spreadsheets/d/17o-foEQFlp6WFiLicLPjxeFGewqj0LrItCVYCYqLy2o/edit?gid=0#gid=0>" %}

{% hint style="danger" %}
Note: Permission **Rest Web Services** is mandatory. In case you do not find it under Setup, please follow the steps below to enable them first.
{% endhint %}

Enable the feature at Setup > Company > Setup Tasks > Enable Features, in the SuiteTalk (Web Services) section, on the SuiteCloud subtab.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FQwVCqE0JhHIR5ga2wR85%2FNS9.png?alt=media&#x26;token=dd079aed-b077-47ae-aca0-4538fbf92dd0" alt=""><figcaption></figcaption></figure>

#### **Step 3: Create a User and assign the above Role to that User**

* From the menu bar, navigate to **Lists** > **Employees** > **Employees** > **New.**

![](https://lh4.googleusercontent.com/tqON13oXwm1guLmgTpppzk2dpSBd-W8VGwCPOgErNoCvi8Taj_Chy3RXmLreKjvQc_JErNEN5torUyxM11u-U7ayTEnZdfpGDdqJF6q8wj4zG3T2sVBt8_bcA_LsNCakYcXzx1E5vApk1nBuXQ)

* Enter your name and the email address provided to you by your customer success manager.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2Fb2D2PbvZHlT72ZIllB07%2FNS10.png?alt=media&#x26;token=22657ece-1572-4cb1-8a5d-2f056a51441e" alt=""><figcaption></figcaption></figure>

* Click the **Access** subtab.
* Check **Give Access** and **Send Notification Email.**
* Assign a password of your choice.
* Select the Role you created in Step 1 and click **Add.**

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FCFYrB9zZqWXRPcma9Y28%2FNS11.png?alt=media&#x26;token=e2bf37fb-6175-45f1-9166-f4966c290693" alt=""><figcaption></figcaption></figure>

* Click on **Save.**

#### **Step 4: Create an Integration**

* From the menu bar, navigate to **Setup** → **Integration** → **Manage** **Integrations** → **New.**

![](https://lh3.googleusercontent.com/epmwoYHByszcSIDI6Gq5s5ht72nsOonU_dbPetJgg3t0Jc6iarKLBwGYRhP2U_HQogkmVIV9z-lLvVC3YApqPxoMxgFFFAPxqkQGUGIr29qPE9qbMaTo4c9kzjrJe3MDFr2oQzdo0uyU5hUFoA)

* On the Integration page,
  * Fill in the **Name** field. We recommend using "<mark style="color:green;">DrivetrainIntegration</mark>".
  * In the Token-based Authentication section, check **TOKEN-BASED AUTHENTICATION** and uncheck **TBA: AUTHORIZATION FLOW.**
  * In the **OAuth 2.0** section, uncheck **AUTHORIZATION CODE GRANT.**

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FdY7KoxkfP5qsqCsBbkwi%2FNetSuite3.png?alt=media&#x26;token=02d2c57d-3f4a-4415-b10d-d4fefa6394c0" alt=""><figcaption></figcaption></figure>

* Click on **Save.**

After you've saved the settings above, scroll down to the bottom of the page to get:

* **Consumer Secret**
* **Consumer Key**

{% hint style="info" %}
Please make note of these items, as they will be required later.
{% endhint %}

#### Step 5: Generate the Token Key and Token Secret

* Log into NetSuite with the user account you set up in Step 2.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2F84s4mqoqIeySo38vYiCI%2FNetS4.webp?alt=media&#x26;token=7f5bbe8d-6799-4f13-a8dd-ed5925668f83" alt=""><figcaption></figcaption></figure>

* Click the **Home** icon.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FSrZxt34onS2N7x2AgvlL%2FNetS5.webp?alt=media&#x26;token=9b9e11b5-b074-404f-883c-80ba0c3828c6" alt=""><figcaption></figcaption></figure>

* Scroll to the bottom.
* Click **Manage Access Tokens.**

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FymggAMhk7XGmIQGDOU8p%2FScreenshot%202023-12-10%20at%202.09.11%20PM.png?alt=media&#x26;token=3c30a17e-ec4e-43c1-8e82-770c39914a65" alt=""><figcaption></figcaption></figure>

* Click **New My Access Token.**

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FgKw6fBgicG5lQfG7QNae%2FScreenshot%202023-12-10%20at%202.10.54%20PM.png?alt=media&#x26;token=d9b17f41-7cae-4850-a117-4c32c5a295a1" alt=""><figcaption></figcaption></figure>

* In the dropdown list for **APPLICATION NAME**, select the integration you created in Step 3.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FJc1AXukbgckG7VAyV2F6%2FScreenshot%202023-12-10%20at%202.12.24%20PM.png?alt=media&#x26;token=f43c7089-3dcb-48f3-9f3f-28f33e15cb66" alt=""><figcaption></figcaption></figure>

Click **Save** and scroll down to the bottom of the page to get the:

* **Token Key**
* **Token Secret**

{% hint style="info" %}
Please make note of these items, as they will be required later.
{% endhint %}

#### **Step 6: Get Account ID**

* From the menu bar, navigate to **Setup** → **Company** → **Company** **Information.**

![](https://lh6.googleusercontent.com/oymCtv12D4CRqf6ob5q3JMXBf2rMw0n3aatpp_6GobR3zgIwmUsvVUNM2FlpSZhVgiXkYjCQAuXIc6y7K7EQq03pPXO-U3JYGhbAt5Cnl4Wr2Ns8PjkRaYdkiNlMGULftuSWjXdiGllhCrtm1w)

You will find the **Account ID** here. Please note it down.

{% hint style="info" %}
This completes your NetSuite setup. If you have any questions or run into any issues with this part of the integration process, please contact your customer success manager for assistance.
{% endhint %}

#### Step 7: Set up NetSuite Saved Search

1. Download the Script from <https://highway-cdn.drivetrain.ai/scripts/DrivetrainSavedSearch.zip> and unzip it.
2. To install the script, navigate to **Customization** > **Scripting** > **Scripts** > **New**. You'll see the Upload Script File form.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FISpRFccv32YAcTu1eXs8%2FScreenshot%202024-09-05%20at%201.26.56%E2%80%AFPM.png?alt=media&#x26;token=511f975f-0286-42b5-b983-d79957505fba" alt="" width="563"><figcaption></figcaption></figure>

3. Hover over the Script File field, and you'll see a "**+"** button appear to the right of the field. Click the button and the File upload form will appear.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FUWqsrhUfhg99gJO0CnP8%2FScreenshot%202024-09-05%20at%201.29.02%E2%80%AFPM.png?alt=media&#x26;token=41963cdb-811b-4f19-918a-5eaa454eac94" alt="" width="375"><figcaption></figcaption></figure>

4. By default, the script will be uploaded to SuiteScripts folder in your File Cabinet (or to the last folder that you uploaded a script to). If you'd like to install the script in an alternative folder, select it from the Folder field.
5. Next, click the **Choose File** button in the Select File field. Then navigate to the folder that you unzipped the file to, and select the file.
6. Then click the **Save** button. The file will be uploaded, and then the Upload Script File form will reappear, with the Script File field loaded.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FrIDIeLTf5FWHGSWhHRnf%2FScreenshot%202024-09-05%20at%201.31.54%E2%80%AFPM.png?alt=media&#x26;token=4f99c3a2-5d18-4ce1-a8f0-f38605eda8e2" alt="" width="563"><figcaption></figcaption></figure>

7. Upon save, the script file will be populated in the Upload Script File form and then click on **Create Script Record** button. The Script form will appear.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FrC3tAvj5GelGWBYsbLCh%2FScreenshot%202024-09-05%20at%201.36.06%E2%80%AFPM.png?alt=media&#x26;token=39e2cadf-3e73-4ae6-b52c-e3e8e26c9e8a" alt="" width="563"><figcaption></figcaption></figure>

8. In the script form, enter **Name** and **ID** as follows. Click on the **Deployments** tab, and enter the Title as "DrivetrainSavedSearc&#x68;**"**.
9. Mark the status as **Released**.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2F4UgeUND7wHO4c5555Dc9%2FScreenshot%202024-09-05%20at%201.39.39%E2%80%AFPM.png?alt=media&#x26;token=b0248bbb-d5ca-4ad3-96f4-e49ddbefba4b" alt="" width="563"><figcaption></figcaption></figure>

10. Click **Save** to finish the installation process.
11. After saving, click on the Deployment title to view the Script Deployment Form.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FiFQIUKBKHQ0Xb7zLRXme%2FScreenshot%202024-09-05%20at%201.40.52%E2%80%AFPM.png?alt=media&#x26;token=e4fb333b-de35-4c37-a24b-15294603d226" alt="" width="563"><figcaption></figcaption></figure>

12. Make a note of **External URL**.
13. Edit the Script Deployment and update the role for the script (which you created for Drivetrain Integration) and click on **Save**.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2F517RV7RYcjWa6hlsFWOp%2FScreenshot%202024-09-05%20at%201.53.01%E2%80%AFPM.png?alt=media&#x26;token=772a958c-b106-416b-84aa-5981b732f781" alt="" width="563"><figcaption></figcaption></figure>

14. Go to **File Cabinet** and select **New** Folder.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2F00ozEgSRXblU5XrgqQ2V%2FScreenshot%202024-09-05%20at%201.43.23%E2%80%AFPM.png?alt=media&#x26;token=e5c7ab04-25e3-4c9b-8c09-d19f1d208333" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FySbpp3IMN6quKd88nH9b%2FScreenshot%202024-09-05%20at%201.44.03%E2%80%AFPM.png?alt=media&#x26;token=99c558c3-6404-4c23-b707-45f72cd3d9cc" alt="" width="563"><figcaption></figcaption></figure>

15. Add a folder “DrivetrainExports” in the root of File Cabinet and click **Save**.

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FQayerkOMwqNsJ8kQV8oO%2FScreenshot%202024-09-05%20at%201.44.56%E2%80%AFPM.png?alt=media&#x26;token=b2b8eb7e-c06a-4180-8e19-99b716e83f73" alt="" width="563"><figcaption></figcaption></figure>

### Drivetrain Setup

#### Step 1: Navigating to the NetSuite Connector

* Sign in to your Drivetrain instance. Make sure you are logged in as an administrator.
* Click on **+ New Data Source.**

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FCvXHr6UPqVl1asxhM1FB%2FSalesforce%200.png?alt=media&#x26;token=813ca00d-8c10-4faa-8b12-1a2f87d048ef" alt=""><figcaption></figcaption></figure>

* Select the NetSuite Data Connector from the list of integrations by clicking **+Connect.**

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FPsHIIdgZ9H4S0k3jrLkm%2FScreenshot%202023-06-13%20at%2011.25.20%20PM.png?alt=media&#x26;token=ff353838-6a41-4b58-af1a-985f78dc617f" alt=""><figcaption></figcaption></figure>

#### Step 2: Entering Credentials

* Enter the keys, secrets and account ID you generated when setting up your NetSuite account, and click **Submit.**
  * **Consumer Secret**
  * **Consumer Key**
  * **Account ID**
  * **Token Key**
  * **Token Secret**

<figure><img src="https://1383008947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmByiugojsjqsjrYS7HGI%2Fuploads%2FyoihovTzkvQ0eNksHj8L%2FNS6.png?alt=media&#x26;token=e4fd996b-c60d-4dcd-a3e1-bccfc00af655" alt=""><figcaption></figcaption></figure>

* You will be redirected to the **Connected Integrations** page where you will be able to see your new NetSuite connection. Once the sync is complete, you will be able to see your NetSuite data on Drivetrain!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://integrations.drivetrain.ai/integration-guide/integrate-with-drivetrain/others/integrating-with-netsuite-role-based-access.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
