Top Banner
Cook Book to create SFDC Configuration Project in Mule 3.6 and Above Using Query Builder. Purpose : This document Helps beginners to connect the Salesforce via Mule SFDC connector by using the new Data Senses Query Language and Query Builder. Pre-requisites: 1. Salesforce Developer Account ( with System Administrator Access) 2. After Successful Login, To Know your profile Go to My profile Logged User Role 3. Note: With System Administrator Access, You can see Reset Security Token option. 4. Go to My settings Personal Reset My Security Token
13
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mule-SFDC-cook book

Cook Book to create SFDC Configuration Project in Mule 3.6 and Above Using Query Builder.

Purpose : This document Helps beginners to connect the Salesforce via Mule SFDC connector by using the new Data Senses Query Language and Query Builder.

Pre-requisites:

1. Salesforce Developer Account ( with System Administrator Access)

2. After Successful Login, To Know your profile Go to My profile Logged User Role3. Note: With System Administrator Access, You can see Reset Security Token option. 4. Go to My settings Personal Reset My Security Token

Page 2: Mule-SFDC-cook book

5. When Reset My Security Token pressed then New security token sent to registered email.

Page 3: Mule-SFDC-cook book

1. Create A Mule project in Anypoint Studio.

Page 4: Mule-SFDC-cook book
Page 5: Mule-SFDC-cook book

2. Create Global configuration for the salesforce connector and HTTP Listener (mule 3.6 and above). Configure Salesforce User ID, Password and the security Token.(Received in email)

3. Test Connection until it gets successful. ( Best practice is to give reference variables rather than hardcoding the values for future changes)

Page 6: Mule-SFDC-cook book

Configure HTTP configuration

Configure Salesforce component : Add the reference to the global SFDC connector.

Page 7: Mule-SFDC-cook book

Click on the Query Builder: Select the Type you trying to build the Query. It enables the fields to be selected.

In addition to the Query fields we can add the filters, Order By, Limit, Direction and offset.

Page 8: Mule-SFDC-cook book

Simple Salesforce configuration

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:sfdc="http://www.mulesoft.org/schema/mule/sfdc" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"

xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd

http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd

http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd

http://www.mulesoft.org/schema/mule/sfdc http://www.mulesoft.org/schema/mule/sfdc/current/mule-sfdc.xsd

Page 9: Mule-SFDC-cook book

http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">

<sfdc:config name="Salesforce__Basic_authentication" username="[email protected]" password="xxxxxx" securityToken="yq2RUzVxdJsCWV5DFYDgFfjt" doc:name="Salesforce: Basic authentication"/>

<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8065" basePath="sfdcdemo" doc:name="HTTP Listener Configuration"/>

<flow name="sfdc_demoFlow">

<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>

<sfdc:query config-ref="Salesforce__Basic_authentication" query="dsql:SELECT AccountNumber,Id,Name FROM Account ORDER BY AccountNumber ASC LIMIT 5 OFFSET 1" doc:name="Salesforce"/>

<json:object-to-json-transformer doc:name="Object to JSON"/>

</flow>

</mule>

Run Project.

Page 10: Mule-SFDC-cook book

SFDC SOQL Query Result: in Web browser

Thank You

GDS Sashidhar Rao

[email protected]

Twitter: Gdssrao