July 30, 2023

tNetsuiteInput – Docs for ESB 7.x

tNetsuiteInput

Invokes the NetSuite SOAP service and retrieves data according to the conditions you
specify.

tNetsuiteInput Standard properties

These properties are used to configure tNetsuiteInput running
in the Standard Job framework.

The Standard
tNetsuiteInput component belongs to the Business and the Cloud families.

The component in this framework is available in all Talend
products
.

Basic settings

Connection Component

Select a tNetsuiteConnection component to reuse its
connection details to set up the connection to the NetSuite server.

With a tNetsuiteConnection selected, the settings
related to connection setup will not be displayed.

Endpoint

Enter the WebService URL required to connect to the
NetSuite server.

API version

Select the version of the NetSuite API you are connecting to.

As of version 7.1, API versions 2014.2 and 2016.2 have been
deprecated.

E-mail and Password

Enter your user credentials to access the
NetSuite SOAP service.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

Role

Enter your NetSuite role ID.

Account

Enter your NetSuite web services account number (also called account
ID).

Application ID

Enter the NetSuite application ID generated for your account.

An application ID is required starting from NetSuite version 2015 and
above. You can find your application ID or create a new one on
NetSuite’s Manage Integration page.

Record Type

Click the […] button next to
the field to open a dialog box, and then select a record type you want to
retrieve or select the Use custom object check box
and specify a custom record type in the Object Name
field.

Schema and Edit schema

A schema is a row description. It defines the number of fields
(columns) to be processed and passed on to the next component. When you create a Spark
Job, avoid the reserved word line when naming the
fields.

 

Built-In: You create and store the schema locally for this component
only.

 

Repository: You have already created the schema and stored it in the
Repository. You can reuse it in various projects and Job designs.

 

Click Edit
schema
to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this
    option to view the schema only.

  • Change to built-in property:
    choose this option to change the schema to Built-in for local changes.

  • Update repository connection:
    choose this option to change the schema stored in the repository and decide whether
    to propagate the changes to all the Jobs upon completion. If you just want to
    propagate the changes to the current Job, you can select No upon completion and choose this schema metadata
    again in the Repository Content
    window.

Warning:

The schema of this component is dynamically filled with columns
corresponding to the NetSuite service fields, which vary depending
on the Record Type selected.
You can delete columns that are not relevant to your operation, but
do not rename any schema columns or this may cause execution
errors.

Search conditions

Define search conditions to match fields for data
retrieval. Click the [+] button
to add as many rows as you need, each row for a condition, and define
each of your conditions:

  • Field: select a field to
    search based on the condition.

  • Operator: select an
    operator for the field search condition.

  • Value: enter the value
    for the field search condition.

  • Value 2: enter the second
    value for the field search condition, if relevant depending on
    the operator you select.

Advanced settings

Body fields only

Select this check box to retrieve only body fields.

Clear this check box to retrieve body fields and sublist values.

Enable customizations

Select this check box to instruct the component to retrieve
customizations – custom record types and custom fields. With this option
enabled, custom record types will be retrieved and can be selected in
the Record Type dialog box, and custom fields
will be retrieved and included into the schema.

This option is enabled by default. You can disable it if you don’t need
custom record types or custom fields.

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at the Job level
as well as at each component level.

Global Variables

Global Variables 

NB_LINE: the number of rows processed. This is an After
variable and it returns an integer.

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see
Talend Studio

User Guide.

Usage

Usage rule

This component is usually used as a start component in a

Talend
flow and it requires an output component.

Handling data with NetSuite

This scenario describes a Job that reads data from NetSuite, transforms the
data and writes the transformed data to NetSuite, finally displays the transformed data on the
console.

tNetsuiteInput_1.png

Adding the components

Create a new Job and add the following five components by typing their names in the
design workspace or dropping them from the Palette:

  • two tNetsuiteInput components: to read data that matches
    the specified search criteria from the NetSuite server.

  • a tMap component: to transform the input data to the
    output structure.

  • a tNetsuiteOutput component: to write the transformed
    data into the NetSuite server.

  • a tLogRow component: to display the data received from
    the NetSuite server.

Configuring and linking the components

Reading, transforming, and writing data in NetSuite

  1. Double-click the first tNetsuiteInput to open its Basic
    settings
    view.

    tNetsuiteInput_2.png

  2. In the Endpoint,
    API version, E-mail, Password,
    Role, Account, and Application ID fields,
    enter the information required to access NetSuite.
  3. Click the […] button next to the Record Type field, and from the dialog box that
    opens select Location to read the
    location type information from NetSuite.

    The schema corresponding to the location record type is automatically
    retrieved.

  4. Define a search condition.

    1. Click the [+] button below the
      Search conditions table to
      add one row.
    2. Click the cell of the Field
      column and select internalId from
      the drop-down list.
    3. Click the cell of the Operator
      column and select List – Any Of
      from the drop-down list.
    4. In the cell of the Value column,
      enter java.util.Arrays.asList(“1”) to retrieve
      only the record whose internalId
      is set to 1.
  5. Connect the first tNetsuiteInput to tMap
    using a Row > Main connection.
  6. Double-click tNetsuiteOutput to open its Basic
    settings
    view.

    tNetsuiteInput_3.png

  7. In the Endpoint,
    API version, E-mail, Password,
    Role, Account, and Application ID fields,
    enter the information required to access NetSuite.
  8. In the Action list, select insert to insert the transformed data into
    NetSuite.
  9. Click the […] button next to the Record Type field, and in the dialog box that
    opens select Location to write the
    location type information into NetSuite.
  10. Click the […] button
    next to Edit schema to open the schema
    editor. You can see the schema has already been prefilled. Keep only the columns
    that are relevant to your operation and delete others. In this example, keep the
    column Name, Parent, IncludeChildren, IsInactive, TranPrefix, Logo, MakeInventoryAvailable, MakeInventoryAvailableStore, CustomFieldList,
    and ExternalId.

    tNetsuiteInput_4.png

  11. Connect tMap to
    tNetsuiteOutput using a Row > *New Output*
    (Main)
    connection. In the pop-up dialog box, enter the name of
    the output connection, out in this example. Then click
    Yes to let tMap get the schema of the target component tNetsuiteOutput.
  12. Double-click tMap to
    open its Map Editor and configure data
    flow mappings.

    tNetsuiteInput_5.png

    1. In the out output table, set the value of the
      Name column by entering “Paris” in the corresponding Expression column field.
    2. Drag and drop the Parent column in the row1 input table onto the Expression column of the corresponding
      row in the out output table.
    3. Do the same to drag and drop other columns IncludeChildren, IsInactive, TranPrefix, Logo, MakeInventoryAvailable, MakeInventoryAvailableStore, CustomFieldList, and ExternalId in the
      row1 input table onto the Expression column of the corresponding
      row in the out output table.

Retrieving the transformed data from NetSuite

  1. Double-click the second tNetsuiteInput to
    open its Basic settings view.

    tNetsuiteInput_6.png

  2. In the Endpoint,
    API version, E-mail, Password,
    Role, Account, and Application ID fields,
    enter the information required to access NetSuite.
  3. Click the […] button next to the
    Record Type field, and from the
    dialog box that opens select Location to
    read the location type information from NetSuite.

    The schema corresponding to the location record type is automatically
    retrieved.

  4. Define a search condition.

    1. Click the [+] button below the
      Search condition table to add
      one row.
    2. Click the cell of the Field
      column and select name from the
      drop-down list.
    3. Click the cell of the Operator
      column and select String –
      Contains
      from the drop-down list.
    4. In the cell of the Value column,
      enter Paris to retrieve only the record whose
      name contains Paris.
  5. Double-click tLogRow to open its Basic settings view.

    tNetsuiteInput_7.png

  6. In the Mode area, select Vertical (each row is a key/value list) for better
    readability of the result.
  7. Connect the second tNetsuiteInput to
    tLogRow using a Row > Main connection.
  8. Connect the first tNetsuiteInput to the
    second tNetsuiteInput using a Trigger > OnSubjobOk connection.

Saving and executing the Job

  1. Press Ctrl + S to save the Job.
  2. Press F6 or click Run on the Run tab to run the
    Job.

    tNetsuiteInput_8.png

    As shown above, the data has been transformed and written into NetSuite, then
    the transformed data is retrieved from NetSuite and displayed on the
    console.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x