NetSuite API

Overview

These public interfaces are used in NetSuite components. They are provided for implementing advanced functionality in your scripts. In order for you to use these interfaces in your project, you have to reference CozyRoc.SSISPlus.dll and CozyRoc.NetSuite.dll libraries. Also include CozyRoc.SqlServer.SSIS, CozyRoc.NetSuite and CozyRoc.NetSuite.Service namespaces.

IConnection / INetSuiteConnection

When you call NetSuite Connection Manager AcquireConnection method, it returns object implementing IConnection interface. This is the interface used for interaction with NetSuite service.

Connect method

Connects to NetSuite service. The method result is object implementing NetSuite SuiteTalk web services.

Close method

Closes the connection to NetSuite service. Use always after you finish working with the service.

IsConnected method

Returns true if connected to the service.

GetService method

Get NetSuite web service object.

GetRecordList method

Returns list of available NetSuite records for specific operation. These are the method parameters:

  • operation (uint) – It can be one of the options listed in the following table.

    Value Description
    0 Return records, which can be read.
    1 Return records, which support adding.
    2 Return records, which can be updated.
    3 Return records, which support remove.
    4 Return records, which support upsert.

GetCompositeRecordList method (1.6 SR-1)

Gets specified record composite records list. These are the method parameters:

  • root (string) – record name.

GetRecord method

Get object used to manage NetSuite record. The method returns IRecord object. These are the method parameters:

  • record (object) – record name or NetSuite Record object.

SearchBasic method

Get search result for specified record. The method returns SearchResult object. These are the method parameters:

  • record (string) – record name.
  • criteria (IDictionary) – optional. Set to retrieve records for specified criteria.

Search method

Retrieves records from NetSuite service. These are the method parameters:

  • criteriaXML (string) – Specify NetSuite search record statement. The statement should be the same XML format used in NetSuite search method.
  • validateOnly (bool) – if true, the specified search statement is validated and no search against the service is performed.

GetSearchRow method (1.6 SR-2)

Get object used to manage NetSuite search row. The method returns ISearchRow object. These are the method parameters:

  • searchRow (object) – NetSuite SearchRow object.

GetSavedSearch method (1.6 SR-2)

Returns array of saved search identifiers for specified type. These are the method parameters:

  • searchType (Type) – type object.

ServerUrl property (string)

Specify NetSuite service URL. This property should be explicitly specified when doing sandbox testing.

ServerUser property (string)

Specify user name to access the NetSuite service.

ServerPassword property (string)

Specify user password to access the NetSuite service.

AccountId property (string)

Specify accountID to access the NetSuite service.

RoleId property (string)

Specify role to access the NetSuite service. If you don’t specify a role, the user’s default role is used.

ServerTimeout property (int)

Specify the number of seconds before timing out session connect. The default value of this property is 100 seconds.

RetainSameConnection property (bool)

Specify if all clients should use the same connection. This property has the options listed in the following table.

Value Description
True All clients use same connection (default).
False Every client uses different connection.

ProxyHost property (string)

Specify the name or IP address of the proxy server.

ProxyPort property (int)

Specify the port number on the proxy server to use for the connection.

ProxyUser property (string)

Specify user name to access the proxy server.

ProxyPassword property (string)

Specify password to access the proxy server.

IField / INetSuiteField

This interface is used to retrieve NetSuite record field information.

Name property (string)

Returns field name.

IsKey property (bool)

Returns true if field is record key.

FieldType property (DataType)

Returns field type.

Length property (int)

Returns field length.

Precision property (int)

Returns field precision.

Scale property (int)

Returns field scale.

IRecord / INetSuiteRecord

This interface is used for NetSuite record management.

GetRecordType method

Returns the NetSuite RecordType.

GetFields method

Get record fields. The method returns array of IField objects.

NewRecord method

Constructs new in-memory NetSuite record instance.

SetFieldValue method

Sets field value in a record. These are the method parameters:

  • record (object) – record instance.
  • field (string) – field name.
  • value (object) – field value.

GetFieldValue method

Returns field value from record object. These are the method parameters:

  • record (object) – record instance.
  • field (string) – field name.

GetCompositeData method

Retrieves records of composite object. These are the method parameters:

  • record (object) – instance to main NetSuite record object.
  • id (string) – composite object identifier. Multiple identifiers are separated with semicolon (;).

UpdateComposite method

Updates composite object. These are the method parameters:

  • record (object) – NetSuite record object.
  • id (string) – composite object identifier. Multiple identifiers are separated with semicolon (;).
  • list (object array) – array of composite NetSuite objects.

Name property (string)

Returns the NetSuite record name.

IsComposite property (bool)

Returns true if composite object.

ISearchRow (1.6 SR-2)

This interface is used for NetSuite search row.

GetFields method

Get search row fields. The method returns array of IField objects.

GetFieldValue method

Returns field value from search row object. These are the method parameters:

  • searchRow (object) – searchRow instance.
  • field (string) – field name.

Record property (string)

Returns the NetSuite record name.