Netsuite Guide

×

REQUEST FREE TRIAL

Share A Little Information To Request Free Trial

Created with Sketch.
REQUEST FREE TRIAL

How to use this guide

In this guide we'll describe how to work with NetSuite using Tray's NetSuite connector.

You will need to have already set up your NetSuite authentication by following this guide.

This guide describes how to interact with NetSuite records by making reference to a template that we have prepared for you. You will be asked to select your NetSuite authentication or to create a new one. Once the setup is complete, do not select RUN WORKFLOW NOW. Select EDIT WORKFLOW (ADVANCED).

This will open a small workflow that will give you an example for each of the next sections.

You can install this template here.

Add a Record

Adding a record requires two parameters to be set about the record followed by any number of fields.

First, let's take a look at the record parameters:

  • Type
  • Namespace

Type

You will usually find the record type you wish to add through the NetSuite UI. Record types are things like "Customer", "Lead", or "Employee".

A comprehensive list of record types can be found using the NetSuite Records Browser.

Namespace

NetSuite requires a namespace to be set, too.

You need to find the namespace for your record type. Look up your record type using the Netsuite Schema Browser.

Note the namespace for your record type.

You'll then need to look up the alias for that namespace in Table 1 at the end of this guide.

Select this alias from the dropdown in Tray.

You can then select a number of fields to add to the record. The available fields can be found in the NetSuite Records Browser.

Note the "Type" column in the Records Browser. Some fields have more complex types which will need to be accounted for in the field object in Tray. See, for example, the subsidiary field which has its own definition. Clicking on "RecordRef" gives information about the object structure for this field. You can see in this example how this maps to the relevant structure in Tray.

Get a Record

Getting records requires a Record Type and an Internal ID. Both of these can be found from the NetSuite UI - but it is more likely that you will get the Internal ID from elsewhere in Tray. For example, it can be found in the output whenever you add a record.

A comprehensive list of record types can be found using the NetSuite Records Browser.

Note that when getting a record the Record Type must be set in lower case.

Update a Record

Updating a record works just like adding a record. You can follow the same instructions above with one exception - you must also provide and Internal ID - just like when you get a record.

Search Records

Searching requires two parameters to be set about the record being searched for, followed by any number of search criteria.

Record Parameters

There are two require record parameters:

  • Type
  • Namespace

Type

You will usually find the record type you wish to search for through the NetSuite UI. Record types are things like "Customer", "Lead", or "Employee".

Look up your record type using the Netsuite Schema Browser.

Scroll to the bottom of the page and look for the Related Searches section.

Enter your type as the first of these search names. This is usually your type with the suffix "Search" (e.g. CustomerSeach, ContactSearch)

Alternatively, by clicking the Search tab you can view a list of all possible searches. Only the simplest kind, suffixed with just "Search", are available within Tray.

Namespace

NetSuite requires a namespace to be set, too.

You need to find the namespace for your record type. Note that this is the namespace for your search type (e.g. CustomerSearch), not your type (e.g. Customer). Look up your record type using the Netsuite Schema Browser.

Note the namespace for your record type.

You'll then need to look up the namespace alias in Table 1 at the end of this document.

Select this alias from the dropdown in Tray.

Search Criteria

This is where you define your search. The structure here is very specific. When creating new searches you will need to copy this object structure carefully.

In our example we're going to search for a customer by their email. To understand which fields can be searched by you can use the Netsuite Schema Browser. From the page for your search select the Basic type.

This gives you a list of all of the fields that can be used in your search criteria.

Looking at this list we can see that we can search by email. Here is the example from the template showing what our final query will look like. We'll now discuss how to construct each part of this query.

First, the "Name" field will always be the same as the "Namespace" field suffixed with ":basic".

Next we define that we want to do a search by the email field. Find the namespace from the "CustomerSearchBasic" page and look up its alias in Table 1 at the end of this document.

We enter the namespace alias and the field here, separated by a semi-colon.

Next, select the type for the email field. It'll open a page called "SearchStringField".

Look up the alias for this namespace in Table 1 at the end of this document. Create the input for the name by concatenating the alias with the field name, separated by a semi-colon. The value is the text string you wish to search.

Finally, we need to add a couple of attributes. We know that we need to add these because they appeared on the "SearchStringField" page.

Opening this operator gives us the information we need to fill in the attributes section. Look up the namespace alias from Table 1 at the end of this document. Together with the name of the operator and the name "SearchStringField" these form the output for the final part of the query.

Delete a Record

Deleting records requires a Record Type and an Internal ID. Both of these can be found from the NetSuite UI - but it is more likely that you will get the Internal ID from elsewhere in Tray. For example, it can be found in the output whenever you add a record.

A comprehensive list of record types can be found using the NetSuite Records Browser.

Note that when deleting a record the Record Type must be set in lower case.

There is also the option to include a Deletion Reason Code and Deletion Reason Memo. These are optional fields useful for keeping track of how a record has come to be deleted.

You can find the list of valid Deletion Reason Codes from the NetSuite UI and going to Setup > Accounting > Accounting Lists.

Appendix 1 - Table 1 (Namespace to Alias Mappings)

NamespaceNamespace Alias

urn:accounting.lists.webservices.netsuite.com

listAccounting

urn:bank.transactions.webservices.netsuite.comtransaction

transactionBank

urn:common.platform.webservices.netsuite.com

platformCommon

urn:communication.general.webservices.netsuite.com

generalCommunication

urn:core.platform.webservices.netsuite.com

platformCore

urn:customers.transactions.webservices.netsuite.com

transactionCustomers

urn:customization.setup.webservices.netsuite.com

setupCustomization

urn:demandplanning.transactions.webservices.netsuite.com

transactionDemandplanning

urn:employees.lists.webservices.netsuite.com

listEmployees

urn:employees.transactions.webservices.netsuite.com

transactionEmployees

urn:faults.platform.webservices.netsuite.com

platformFaults

urn:filecabinet.documents.webservices.netsuite.com

documentFilecabinet

urn:financial.transactions.webservices.netsuite.com

transactionFinancial

urn:general.transactions.webservices.netsuite.com

transactionGeneral

urn:inventory.transactions.webservices.netsuite.com

transactionInventory

urn:marketing.lists.webservices.netsuite.com

listMarketing

urn:messages.platform.webservices.netsuite.com

platformMsgs

urn:purchases.transactions.webservices.netsuite.com

transactionPurchases

urn:relationships.lists.webservices.netsuite.com

listRel

urn:sales.transactions.webservices.netsuite.com

transactionSales

urn:scheduling.activities.webservices.netsuite.com

activityScheduling

urn:supplychain.lists.webservices.netsuite.com

listSupplychain

urn:support.lists.webservices.netsuite.com

listSupport

urn:types.accounting.lists.webservices.netsuite.com

listAccountingTypes

urn:types.communication.general.webservices.netsuite.com

generalCommunicationTypes

urn:types.customization.setup.webservices.netsuite.com

setupCustomizationTypes

urn:types.demandplanning.transactions.webservices.netsuite.com

transactionDemandplanningTypes

urn:types.employees.lists.webservices.netsuite.com

listEmployeesTypes

urn:types.filecabinet.documents.webservices.netsuite.com

documentFilecabinetTypes

urn:types.inventory.transactions.webservices.netsuite.com

transactionInventoryTypes

urn:types.marketing.lists.webservices.netsuite.com

listMarketingTypes

urn:types.relationships.lists.webservices.netsuite.com

listRelTypes

urn:types.sales.transactions.webservices.netsuite.com

transactionSalesTypes

urn:types.scheduling.activities.webservices.netsuite.com

activitySchedulingTypes

urn:types.supplychain.lists.webservices.netsuite.com

listSupplychainTypes

urn:types.support.lists.webservices.netsuite.com

listSupportTypes

urn:types.website.lists.webservices.netsuite.com

listWebsiteTypes

urn:website.lists.webservices.netsuite.com

listWebsite

Appendix II - Further Documentation

NetSuite Basic Search Docs

NetSuite Schema Browser

More Tray Netsuite Docs

NetSuite Help Centre

Last updated 23rd February 2018

REQUEST FREE TRIAL

Share A Little Information To Request Free Trial

Created with Sketch.