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.
Drop tSalesforceConnection, tFixedFlowInput and tSalesforceOutput onto the workspace.
Link tSalesforceConnection to tFixedFlowInput using the OnSubjobOk trigger.
Link tFixedFlowInput to tSalesforceOutput using a Row > Main connection.
Double-click tSalesforceConnection to open its Basic settings view.
In the Login Type list, select OAuth2.
In the Consumer Key and Consumer Secret fields, enter the relevant information.
Double-click tFixedFlowInput to open its Basic settings view.
Select Use Inline Content (delimited file) in the Mode area.
In the Content field, enter the data to write to the Saleforce.com, for example:
Double-click tSalesforceOutput to open its Basic settings view.
Select the Use an existing connection option.
In the Action list, select insert to insert the account name Talend.
In the Module list, select Account.
Click the Edit schema button to open the schema editor.
In the right panel, remove all the columns except Name.
Click to copy the column Name from right to left.
Click OK to validate the setup and close the editor.
Press Ctrl + S to save the Job.
Press F6 to run the Job. The Studio console gives the url (in yellow) for OAuth authorization.
Copy the url to the browser's address bar. The Salesforce.com login page appears.
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.
Now is the time for the sub-job to run.
As shown above, the Job is successfully executed.
Go to the Salesforce.com and check the Account module. We can find that the account name Talend is inserted.