August 17, 2023

tSalesforceConnection – Docs for ESB 5.x

tSalesforceConnection

tSalesforceConnection_icon32_white.png

tSalesforceConnection properties

Component family

Business/Cloud

 

Function

tSalesforceConnection opens a
connection to a Salesforce system in order to carry out a
transaction.

Purpose

The component enables connection to a Salesforce.

Basic settings

Property type

Either Built-in or Repository

Built-in: No property data stored
centrally.

Repository: Select the repository
file in which the properties are stored. The fields that follow are
completed automatically using the data retrieved.

Since version 5.6, both the Built-In mode and the Repository mode are
available in any of the Talend solutions.

 

For salesforce bulk component

Select this check box if you use bulk data processing components
from the salesforce family. Once selected; the Salesforce Version field appears and therein you
need to enter the Salesforce version you are using.

For more information on these bulk data processing components,
see tSalesforceOutputBulk, tSalesforceBulkExec and tSalesforceOutputBulkExec.

 

Login Type

Two options are available:

Basic: select this option to log
in to Salesforce.com by entering your Username/Password on tSalesforceConnection.

OAuth2: select this option to
access Salesforce.com by entering your Consumer key/Consumer Secret
on tSalesforceConnection. This way,
your Username/Password will not be exposed to tSalesforceConnection but extra work is required:

 

Salesforce Webservice URL

Enter the Webservice URL required to connect to the Salesforce
database.

 

Salesforce Version

Enter the Salesforce version you are using.

 

Username and
Password

Enter your Web service authentication details.

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.

 

Consumer Key and Consumer
Secret

Enter your OAuth authentication details. Such information is
available in the OAuth Settings
area of the Connected App that you have created at
Salesforce.com.

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

For what a Connected App is, see Connected Apps. For how to create a Connected App, see
Defining Remote Access Applications.

 

Callback Host and Callback
Port

Enter your OAuth authentication callback URL. This URL (both host
and port) is defined during the creation of a Connected App and will
be shown in the OAuth Settings area
of the Connected App.

 

Token File

Enter the token file name. It stores the refresh token that is
used to get the access token without authorization.

 

Use Soap Compression

Select this check box if you want to activate SOAP
compression.

Note

The compression of SOAP messages results in increased
performance levels.

 

Timeout (milliseconds)

Type in the intended number of query timeout in
Salesforce.com.

 

Output Http Trace Message

Select this option to output the Http interactions on the Studio
console.

Available when For salesforce bulk
component
is selected.

 

Use Socks Proxy

Select this check box if you want to use a proxy. Once selected,
you need type in the connection parameters in the fields which
appear. These parameters are the host, the port, the username and
the password of the Proxy you need to use.

Advanced settings

Client ID

Set the ID of the real user to differentiate between those who use
the same account and password to access the salesforce
website.

 

tStatCatcher Statistics

Select this check box to collect the log data at a component
level.

Global Variables

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

This component is normally used with Salesforce
components..

Log4j

The activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User
Guide
.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Limitation

Due to license incompatibility, one or more JARs required to use this component are not
provided. You can install the missing JARs for this particular component by clicking the
Install button on the Component tab view. You can also find out and add all missing JARs easily on
the Modules tab in the Integration perspective
of your studio. For details, see https://help.talend.com/display/KB/How+to+install+external+modules+in+the+Talend+products
or the section describing how to configure the Studio in the Talend Installation and Upgrade
Guide
.

Scenario: Using OAuth2 to log in to Salesforce.com

In this scenario, the OAuth2 (Open Authorization 2.0)
method is adopted to authorize tSalesforceConnection to
access the Salesforce.com resources. This way, better security is achieved as users do
not need entering their Salesforce username/password directly on tSalesforceConnection, which is required by the Basic login type instead.

Linking the components

  1. Drop tSalesforceConnection, tFixedFlowInput and tSalesforceOutput onto the workspace.

  2. Link tSalesforceConnection to tFixedFlowInput using the OnSubjobOk trigger.

  3. Link tFixedFlowInput to tSalesforceOutput using a Row > Main
    connection.

    use_case_tsalesforceconnection_1.png

Configuring the components

  1. Double-click tSalesforceConnection to
    open its Basic settings view.

    use_case_tsalesforceconnection_2.png
  2. In the Login Type list, select OAuth2.

  3. In the Consumer Key and Consumer Secret fields, enter the relevant
    information.

  4. Double-click tFixedFlowInput to open its
    Basic settings view.

    use_case_tsalesforceconnection_3.png

    Select Use Inline Content (delimited
    file)
    in the Mode
    area.

  5. In the Content field, enter the data to
    write to the Saleforce.com, for example:

  6. Double-click tSalesforceOutput to open
    its Basic settings view.

    use_case_tsalesforceconnection_4.png
  7. Select the Use an existing connection
    option.

  8. In the Action list, select insert to insert the account name Talend.

  9. In the Module list, select Account.

  10. Click the Edit schema button to open the
    schema editor.

    use_case_tsalesforceconnection_5.png
  11. In the right panel, remove all the columns except Name.

  12. Click button_copy_all_from_out_to_in.png to copy the column Name from right to left.

  13. Click OK to validate the setup and close
    the editor.

Executing the Job

  1. Press Ctrl + S to save the Job.

  2. Press F6 to run the Job. The Studio
    console gives the url (in yellow) for OAuth authorization.

    use_case_tsalesforceconnection_8.png
  3. Copy the url to the browser’s address bar. The Salesforce.com login page
    appears.

    use_case_tsalesforceconnection_9.png
  4. Fill up the username and password and click Log in
    to Salesforce
    .

    The authorization response is then shown on the browser at the callback
    host.

    use_case_tsalesforceconnection_10.png
  5. Now is the time for the sub-job to run.

    use_case_tsalesforceconnection_11.png

    As shown above, the Job is successfully executed.

  6. Go to the Salesforce.com and check the Account module. We can find that
    the account name Talend is
    inserted.

    use_case_tsalesforceconnection_12.png

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