DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • The Real-time Data Transfer Magic of Doris Kafka Connector's "Data Package": Part 1
  • Designing a Java Connector for Software Integrations
  • Kafka JDBC Source Connector for Large Data
  • Make Your Integration Seamless By Using Ballerina Client Connectors

Trending

  • How AI Is Transforming Software Engineering and How Developers Can Take Advantage
  • How to Format Articles for DZone
  • A 5-Step SOC Guide That Meets RBI Expectations and Strengthens Security Operations
  • Zone-Free Angular: Unlocking High-Performance Change Detection With Signals and Modern Reactivity

Salesforce Composite Connector in Mule 4

In this article, take a look at the Salesforce Composite Connector in Mule.

By 
Pooja Bhosle user avatar
Pooja Bhosle
·
Apr. 17, 20 · Opinion
Likes (3)
Comment
Save
Tweet
Share
23.7K Views

Join the DZone community and get the full member experience.

Join For Free

1. Introduction: Salesforce’s REST API Composite Resource

Salesforce Composite Connector from MuleSoft uses a single REST API call to access several individual Salesforce services, thereby simplifying your code, reducing network overhead, and improving your app’s performance. The connector provides convenient access to Salesforce's composite resources to execute large-scale data operations on Salesforce data.

2. Why Use Salesforce’s REST API Composite Connector?

  • Enables a user to execute dependent requests in a single API call. For example, use the connector to invoke a single composite resource that creates an account and retrieves its information to use it to create a contact.
  • Offers the ability to create a collection of nested parent-child records.
  • Allows you to create and update multiple records in a single request.

3. How to Use

Salesforce Composite Connector will not be available in the Mule palette initially. To get these connectors, search in the Mule palette exchange.    



In this document, we are using “Create sObject tree” connector for understanding.

Below is the configuration for sObject tree connector:

  • Consumer Key and Consumer secret:

For Consumer key and secret, we need to create a connected app in Salesforce.

Go to Setup -> Build -> Create -> Apps -> Create new in Connected apps

Populate all the required basic information:


 Enable OAuth setting:


Save the app.

Click on Manage and set Permitted Users as All users may self-authorize, IP Relaxation as Relax IP restrictions.

 


Now get the Consumer id and secret from the custom app:               




Use this same key and secret in the Salesforce Composite Connector Configuration:

  • Username and Password:

This should be set to the username and password of Salesforce Org where the app is created.

Get back to Anypoint Studio and create a basic flow using the sObject tree connector:


Set payload with sObject tree:

                            


When you run the application, in response, you will get the Salesforce IDs of newly created accounts and contacts.

4.Benefits of Salesforce Composite Connectors:

The Salesforce Composite resources within Salesforce’s REST API can be used to perform complex object interactions that would normally require multiple calls to Salesforce using the real-time API. In certain scenarios, this connector can simplify your flows, reduce the number of API calls to SFDC, and shorten processing time.   

The operations the Composite resources are:

  1. Batch: Batch allows up to 25 separate unrelated actions to be executed in a single call. Each executes independently, and information is not shared between the calls.
  2. SObject Tree: Creates one or more sObject trees with root records of the specified type. An sObject tree is a collection of nested, parent-child records with a single root record.
  3. SObject Collections: Similar to batch, the SObject Collection resource can reduce round trip calls on groups of objects (up to 200) but requires a common action (e.g. Create, Update, Retrieve, or Delete a group of records). This call has the option to specify a rollback behavior in the case of partial failure.
  4. Composite: This will sequentially execute a series of actions in a single call. The response from one action can be used as an input in the subsequent action.
Connector (mathematics)

Opinions expressed by DZone contributors are their own.

Related

  • The Real-time Data Transfer Magic of Doris Kafka Connector's "Data Package": Part 1
  • Designing a Java Connector for Software Integrations
  • Kafka JDBC Source Connector for Large Data
  • Make Your Integration Seamless By Using Ballerina Client Connectors

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook