The User and Password properties, under the Authentication section, must be set to valid NetSuite user credentials. In addition, the AccountId must be set to the Id of a company account that can be used by the specified User. The RoleId can be optionally specified to log in the user with limited permissions.
Connecting to NetSuite
Connecting to NetSuite is fairly straightforward. Simply provide the User, Password, and AccountId properties to connect. It is also recommended but not required to specify the RoleId and NetsuiteMetadataFolder: if RoleId is empty, the user's default role is used. The Netsuite Metadata Folder is a folder on disk where NetSuite metadata files will be stored. If you do not specify one, a folder location will be selected automatically. To ensure fast load times when listing metadata about tables, it is best to set this property.
The provider communicates with NetSuite through the NetSuite Web services. This means that the user specified in the connection must have permissions on the specified AccountId to connect through NetSuite Web services. If the user does not already have Web services permissions, an exception stating "You do not have permission to access Web services features" will be thrown when trying to connect. If this happens, an administrator will need to grant Web services permissions to the user by doing the following:
1. Create a Web services role
Instead of using user/password credentials to connect to NetSuite, OAuth authentication can be used instead. Please see Using OAuth Authentication for details on how to connect via OAuth.
By default, NetSuite allows users to establish only one session when connecting to NetSuite at a time. If a second session is started, then the first session will be invalidated. For this reason, we default UseSessions to false. This will cause each request to be its own session. If you set UseSessions to true, be careful to close each connection before starting a new one. Otherwise you may receive an exception that your session has timed out. Please note that some UI editors take up multiple connections, and setting UseSessions to true will cause this exception in this scenario.
By default, NetSuite allows only one request at a time for a given user. If a request is still executing against NetSuite when another one is attempted, an error stating "Only one request may be made against a session at a time" will be thrown on the second connection.
NetSuite response times can take a long time depending on what you are retrieving. This can range from 20-40 seconds to retrieve 1000 SalesOrders to up to 8-12 minutes to retrieve a single page of the SalesOrder_ItemList. The main factor that can affect performance is whether or not child table information is retrieved. For instance, the SalesOrder_ItemList table would be considered the child table of SalesOrder. In addition, the information in the ItemListAggregate on the SalesOrder table would be considered child table information. Because of the significant delay it adds in response times from NetSuite, we have defaulted AggregateColumnMode to Ignore. When set to either Ignore or List, this will cause any Aggregate columns on base tables such as SalesOrder to not request data from NetSuite. This property has no effect on child tables.
Slow NetSuite response times extend to inserts, updates, and deletes as well.This can be especially noticeable when using batch processing. When inserting, updating, or deleting multiple records at a time, it may be worthwhile to set UseAsyncServices to true. This will cause the request to be processed asynchronously on NetSuite's end and a JobId will be returned in the Info#TEMP table. The JobId can be checked against the stored procedures CheckJobStatus and GetJobResults for information about when the job is completed, if any errors occurred, and for the InternalIds for newly created entities.
Using OAuth AuthenticationOAuth requires the authenticating user to interact with NetSuite using the browser. The provider facilitates this in various ways as described below. Custom CredentialsYou must register an app to obtain the OAuthClientId and OAuthClientSecret. When to Create a Custom OAuth AppCreating a custom OAuth app is required in all cases in order to connect via OAuth. Creating a Custom OAuth AppSee Creating a Custom OAuth App for information on how to create a custom app. Custom CredentialsWhen to Use a Custom OAuth AppCreating a custom OAuth app is required in order to connect via OAuth. Desktop Authentication with a Custom OAuth AppFollow the steps below to authenticate with the credentials for a custom OAuth app. See Creating a Custom OAuth App.Get and Refresh the OAuth Access TokenAfter setting the following, you are ready to connect:
Web Authentication with a Custom OAuth AppWhen connecting via a Web application, you need to register a custom OAuth app with NetSuite. See Creating a Custom OAuth App. You can then use the provider to get and manage the OAuth token values. Get an OAuth Access TokenSet the following connection properties to obtain the OAuthAccessToken:
You can then call stored procedures to complete the OAuth exchange:
Refresh the OAuth Access TokenUnlike other sources, NetSuite tokens do not expire. There is no refresh flow. |
AccountId: Required (Number) The Account ID for your Netsuite organization. You can retrieve this number in NetSuite, in the Integration section under Setup.
LogoutUnknownSessions: (Boolean) If you cannot log in because it's complaining there is already an active session, try using this session to force those other sessions to be invalidated.
MaximumConcurrentSessions: (Number) If you wish to use multithreading while writing to NetSuite, you must use this setting. By default, NetSuite does not support mutltithreading. This only becomes available if you have purchased and activated the SuiteCloud Plus license for NetSuite. This will give you the ability to use up to 10 concurrent sessions. If you wish to use 10 threads, then set this parameter to 10, and also use 10 as the value in the Thread Count property on the Run Job tab in Connect Creatio. Using multithreading with NetSuite will greatly improve the speed of writing. If you have to move a large amount of data, we highly recommend acquiring this license.
AggregateColumnMode: (String - available options below) Aggregate columns are the columns that will appear on base tables which aggregate all of the data contained within child collections (such as Address)
Netsuite Metadata Folder: (String) If you get a certain error, it may be necessary to supply a folder where Connect Creatio can temporarily store metadata retrieved from Netsuite. This allows the metadata to be downloaded a cached to help speed up future requests. Recommended to create a "Metadata" folder under StarfishEngine to ensure proper permissions. Default full suggested path would therefore be: C:\Inetpub\wwwroot\StarfishEngine\Metadata. The Metadata folder will not be created automatically. When first setting this parameter, you'll have to create this folder manually.
RoleId: (Number) The RoleId is the InternalId of the role that will be used to log in to NetSuite. If you do not enter this, it will use the user's default role. Useful for forcing Administrator role in certain scenarios.
UseSandbox: (Boolean) Set to true if you would like to use the sandbox instance of your NetSuite account.
When writing to NetSuite Picklist fields, you cannot write the value of the picklist to the field. You must instead reference the Internal Id of the picklist value you wish to use. These can be obtained in the Customization section under Setup. Using a hand-built Xref list for large lists would be recommended practice.
When writing addresses to NetSuite, you must use the AggregateColumnMode=List so that the AddressbookListAggregate Column will be available to map to. Address data must be supplied as a chunk of XML containing the complete address record. See below as an example.
Function ScriptedField
dim xml
xml = "<Customer_AddressbookList>"
xml = xml & "<Row>"
xml = xml & "<AddressbookList_DefaultShipping>true</AddressbookList_DefaultShipping>"
xml = xml & "<AddressbookList_DefaultBilling>true</AddressbookList_DefaultBilling>"
xml = xml & "<AddressbookList_Label>Address</AddressbookList_Label>"
xml = xml & "<AddressbookList_addressee>@@ORG:Name@@</AddressbookList_addressee>"
xml = xml & "<AddressbookList_Addr1>@@ORG:ShippingStreet@@</AddressbookList_Addr1>"
xml = xml & "<AddressbookList_City>@@ORG:ShippingCity@@</AddressbookList_City>"
xml = xml & "<AddressbookList_Zip>@@ORG:ShippingPostalCode@@</AddressbookList_Zip>"
xml = xml & "<AddressbookList_State>@@ORG:ShippingState@@</AddressbookList_State>"
xml = xml & "<AddressbookList_Country>@@ORG:ShippingCountry@@</AddressbookList_Country>"
xml = xml & "</Row></Customer_AddressbookList>"
ScriptedField=xml
End Function
It is possible to supply multiple addresses in a single call by duplicating the entire <Row> node.
It is possible to upload attachments to NetSuite and must be done in two stages.
Parameter | Description |
Account ID | |
Use Sandbox |