Salesforce

How Do I Create My First Salesforce Project? (Magic xpi 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Create My First Salesforce Project? (Magic xpi 3.x)

This topic explains the first steps in creating a Magic xpi Salesforce project.

To create a Salesforce account:

  1. Go to http://www.salesforce.com/developer/

  2. Open a Salesforce account by filling in a subscription form on the site.

  3. You should now receive an email with a login URL. Click the URL to change your password.

  4. After you have changed your password, you should ask for a security token:

    1. Click on the Setup link at the top of the page.

    2. In the My Personal Information section, click on the Reset your security token link to receive an email containing a security token. You will use this later on, when you add the security token to your password, and enter the combined result in the Password field in Magic xpi’s Connections Salesforce dialog box. For example, if the password is 1234, and the security token is AABBCC, you should enter 1234AABBCC in the Magic xpi password field.

Note:

You do not need the security token for logging into the salesforce.com web site. The token is used only when you use external applications such as Magic xpi.

  1. You should now go to https://login.salesforce.com/. Here, you can log in to your Salesforce application.

To create a simple Salesforce project:

In this example, a Query operation is performed for all Channel Customers account types.

Configuring the connection to Salesforce:

  1. Open the Magic xpi Studio, and create a new project.

  2. From the Project menu, select Resources to open the Resource Repository.

  3. Click New. The New Resource dialog box opens.

  4. Select a Salesforce resource type from the drop-down list. In the Resource Name field, enter a name for your new Salesforce resource, and click OK.

  5. Enter your Salesforce server user name and password in the relevant fields. The password is a combination of your Salesforce password and the security token that was supplied by salesforce.com.

  6. Click Validate to test your new connection.

  7. Once the connection has been validated, click Objects List to retrieve the updated supported object list.

  8. Click OK to close the Resource Repository dialog box, and to save your connection definitions.

Configuring the Salesforce connector:

  1. Drag a Salesforce connector to the flow area.

  2. If this is the first time that you have dragged the Salesforce connector to the flow area or the trigger area of the Magic xpi Studio, the Component Properties dialog box opens.

  3. Click Configuration to open the Salesforce Configuration dialog box.

  4. Click next to the Object field, and select the Account object.

  5. In the Operation field, select Query from the drop-down list.

  6. Press CTRL+L to open the Variables for Flow dialog box. Here, define a new BLOB variable called F.ResultBlob.

  7. Click next to the Store Result In field, and select F.ResultBlob to hold the returned XML data.

  8. Click OK to go open the Data Mapper’s Source/Destination Management dialog box.

  9. Click Map to open the main Data Mapper screen.

  10. In the Destination side, double-click on the Type element, and enter Customer – Channel in the Node Properties dialog box’s Calculated Value field. This allows you to query only the channel customers.

  11. Click OK several times, until you exit the configuration screens.

Mapping the Salesforce XML query result to a flat file:

  1. Drag a Data Mapper component into the flow as a child to the Salesforce connector, and click Configuration.

  2. Create a new XML Source type, and click Properties.

  3. Select the account XSD file. You can find this under
    <project name>/salesforce/XSD/<Salesforce.com connection name>/Account.xsd

  4. Select F.ResultBlob as the data source.

  5. Create a new flat file Destination type, and click Properties.

  6. In the Data Destination field, select File from the drop-down list. You should give it the following value:
    EnvVal('currentprojectdir')&'ChannelAccounts.txt'

  7. In the table area, click New three times to create three Alpha fields.

  8. Rename the new fields to Name, Country, and Website.

  9. Click OK, followed by Map.

  10. Map the Name Source node to the Name Destination node.

  11. Map the BillingCountry Source node to the Country Destination node.

  12. Map the Website Source node to the Website Destination node.

  13. Click OK until the Data Mapper is closed.

Running the flow:

  1. Run the project in Debugger mode. Use the step to follow the Salesforce query result, and check that the ChannelAccounts.txt file is available and that it contains all the channel records.

  2. The final flow should look like this:

Reference
Attachment 
Attachment