Skip to end of metadata
Go to start of metadata

NetSuite Connector Functions

These functions are for use with the Jitterbit NetSuite Connector:

NetSuiteGetSelectValue

Declaration

dictionary NetSuiteGetSelectValue(string netSuiteOrg, string recordType, string field[, string sublist])

Syntax

NetSuiteGetSelectValue(<netSuiteOrg>, <recordType>, <field>[, <sublist>])

Required Parameters

Optional Parameters

  • sublist: NetSuite sublist

Description

Retrieves the picklist values for a field from NetSuite.

The function response is a dictionary (map), where:

  • The dictionary keys are the picklist values.
  • The dictionary values are a map with two elements: the internal ID and the external ID for each picklist.
NOTE: The return value should be assigned to a variable and the variable should be used for retrieving corresponding IDs for picklist elements instead of calling this function multiple times.

NOTE: If sublist is given inappropriately, you may get

ERROR  code=INSUFFICIENT_PERMISSION;message=You do not have permissions to set a value for element cef records

due to any of these reasons:

  • The field is read-only.
  • An associated feature is disabled.
  • The field is available either when a record is created or updated, but not in both cases.

Examples

Script Example

netSuiteOrg = "<TAG>NetSuite Endpoints/NetSuite Endpoint</TAG>";
recordType = "customer";
field = "entityStatus";
dict = NetSuiteGetSelectValue(netSuiteOrg, recordType, field);
i1=dict[field]["internalId"]; // or dict[field][0]
e1=dict[field]["externalId"]; // or dict[field][1]

Picklist Example

  1. Go to NetSuite's SuiteTalk Schema Browser at https://system.netsuite.com/help/helpcenter/en_US/SchemaBrowser/indexv2011_2_0.html.
  2. From the Records section in the upper-left, select relationships.xsd, and then select Customer from the resulting list in the lower-left.  The page will then display this Customer Record table:

     
     
    This shows the structure of the Customer Record, and in particular the field names and types available. A "record type" in NetSuite is similar to a Jitterbit object or table name. Record types are case-sensitive.
  3. If you are using a Jitterbit NetSuite Search transformation, you can see the structure, showing a value for the entityStatus:
  4. To retrieve all the picklist values for the field "entityStatus" under the "customer" record type, use a script such as:

    netSuiteOrg = "<TAG>NetSuite Endpoints/Test NetSuite Endpoint</TAG>";
    recordType = "customer";
    field = "entityStatus";
    d = NetSuiteGetSelectValue(netsuiteOrg, recordType, field);
    keys = GetKeys(d);
    $cw.internalId = d[keys[0]]["internalId"];
    $cw.externalId = d[keys[0]]["externalId"];
    keys

    This will return a list of keys, such as:

    {CUSTOMER-Closed Won,CUSTOMER-Lost Customer,CUSTOMER-Renewal}
                  
  5. This test of the example shows that the picklist has three entries, and the first key ("CUSTOMER-Closed Won") has an internal ID of 13.  It does not have an external ID:

NetSuiteGetServerTime

Declaration

string NetSuiteGetServerTime(string netSuiteOrg)

Syntax

NetSuiteGetServerTime(<netSuiteOrg>)

Required Parameters

Description

Retrieves the server date-time from a NetSuite server.

Examples

netSuiteOrg = "<TAG>NetSuite Endpoints/NetSuite Endpoint</TAG>";
NetSuiteGetServerTime(netSuiteOrg);
// Returns a date such as "2017-12-07T21:00:26.000-08:00"

NetSuiteLogin

Declaration

string NetSuiteLogin(string netSuiteOrg)

Syntax

NetSuiteLogin(<netSuiteOrg>)

Required Parameters

Description

Retrieves a new session ID from a NetSuite endpoint for use in REST or SOAP calls that are not included in the NetSuite Connector. This provides a simple way to log into NetSuite without requiring authentication headers for each web service call.

NOTE: Use of this function is not required if you are using a Jitterbit NetSuite Connector.
WARNING: The NetSuite session expires after 15 minutes. It may be invalidated by other calls to NetSuite.

Examples

netSuiteOrg = "<TAG>NetSuite Endpoints/NetSuite Endpoint</TAG>";
NetSuiteLogin(netSuiteOrg);
// Returns a string such as 
// "JSESSIONID=_wXox...847; path=/; HttpOnly;NS_ROUTING_VERSION=LAGGING; path=/;NS_VER=2017.2.0; path=/"

PLM360 Connector Functions

These functions are for use with the Jitterbit Autodesk Lifecycle Connector (formerly Autodesk PLM360):

NOTE: Autodesk Fusion Lifecycle was formerly known as Autodesk PLM360, hence the naming convention of these functions.

PLM360GetItemVersionId

Declaration

string PLM360GetItemVersionId(string plm360Org, int workspaceId, int dmsId)

Syntax

PLM360GetItemVersionId(<plm360Org>, <workspaceId>, <dmsId>)

Required Parameters

Description

Logs in to Fusion Lifecycle and returns the version ID of an item with id=dmsId in the given workspaceId. Returns an empty string if the item is unavailable.

NOTE: The running system will automatically log in if it is not already logged in. It will log in again if the saved session ID becomes invalid.

PLM360Login

Declaration

string PLM360Login(string plm360Org)

Syntax

PLM360Login(<plm360Org>)

Required Parameters

Description

Logs in to Fusion Lifecycle and returns the session ID.

NOTE: The session ID will be saved internally for later reuse in global variables.

PLM360Logout

Declaration

void PLM360Logout(string plm360Org)

Syntax

PLM360Logout(<plm360Org>)

Required Parameters

Description

Logs out of Fusion Lifecycle with the internally saved session ID.

WARNING: This function may not log out of all session IDs when operating with multiple threads executing.

Search in This Topic
On This Page

Last updated:  Feb 27, 2019