Salesforce Tools and Topics for MuleSoft Developers

If you are familiar with MuleSoft but just haven’t worked on a Salesforce project, then this post might be helpful for you.

The Salesforce ecosystem is very large, so this post will focus on the main modules and tools that you can use as MuleSoft engineer to work effectively and productively on your project.

Authentication Methods

First, we must connect with Salesforce. There are several ways to do this, and I will demonstrate several methods:

Basic Authentication: this process requires an username, password, and security token. This information is usually shared by the customer and can be generated from Salesforce. Here is the process to achieve this, as described by Salesforce. Once you obtain the credentials, Mule has the out-of-the-box Salesforce connector where you can use them.

Connected App: there are some use cases for which you can implement connected apps. You can use a connected app to integrate external applications with the Salesforce API, such as a web-based app that pulls in order status data. You can configure a connected app to provide authorization for external API gateways, such as API gateways hosted on MuleSoft’s Anypoint Platform.

Getting a session ID: you also can gain access to Salesforce using the initial three main attributes and the endpoint. You then pass a body, as shown below (thinking you are using Postman), to get a session ID.

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body>
<n1:login xmlns:n1="urn:partner.soap.sforce.com"><n1:username>YOUR_USER_NAME</n1:username><n1:password>PASSWORD_GOES_HERE_WITH_TOKEN</n1:password>
</n1:login>
</env:Body>
</env:Envelope>

Data Retrieval

SOQL Queries: the easiest way to get data from Salesforce is using SOQL queries. This method is a powerful and flexible way to get data directly from an object, to use a nested query, or to pull data from relationship fields (depending on your use case). Keep the limitations in mind while writing your queries.

SOSL Search: another way to get data from Salesforce is through SOSL search. This is helpful when obtaining information from multiple objects that share same criteria. Think about this as a search bar, where we search for a name and link it to a user, contact, or other object. Here is a MuleSoft-recipe with a sample in Mule 4.

Salesforce Reports: though reports aren’t integrated directly with other services, they can be helpful to export, or have provided by Salesforce, in order to generate a CSV file that Mule can eventually read.

Bulk Jobs

As per Salesforce definition:

“The REST-based Bulk API 2.0 provides a programmatic option to asynchronously upload, query, or delete large data sets in your Salesforce org. Any data operation that includes more than 2,000 records is a good candidate for Bulk API 2.0 to successfully prepare, execute, and manage an asynchronous workflow that makes use of the Bulk framework. Jobs with fewer than 2,000 records should involve “bulkified” synchronous calls in REST (for example, Composite) or SOAP. Using the API requires basic familiarity with software development, web services, and the Salesforce user interface. This API is enabled by default for Performance, Unlimited, Enterprise, and Developer Editions. The “API Enabled” permission must be enabled”

Bulk jobs are essential to retrieve or ingest large amounts of data into Salesforce at once (i.e., > 50K records). Once a bulk job is created, the jobs can be monitored directly from Mule or Salesforce. Here is a description explaining how to monitor jobs.

The Salesforce APIs

While Salesforce provides APIs, most of the time we don’t know how or where to call them. The Postman collection explains how you can set up Salesforce APIs.

Resources

  • Salesforce Developers Youtube channel: tutorials and “how to” videos
  • Trailhead: many free resources and step-by-step instructions. The training badges awarded after completing each challenge adds a fun touch!
  • MuleSoft Developer blogs: see real-life samples from community members, demonstrating the many ways Salesforce is used

Salesforce Tools

Below are the tools that I most frequently use and that help me with my integrations with Salesforce.

DataLoader

DataLoader is the tool used most by administrators and developers. This tool allows you to query, export, insert, delete, and upsert data in/to Salesforce. You can read about additional features on the official repository.

SoqlX

Similar to DataLoader, SoqlX allows you to make queries, describe the schema of your org, and export result. This tool is best for making quick queries and running Apex anonymous code.

Postman

While most people are familiar with Postman, it is still worth to mentioning. This tool is used to consume any API.

VSCode

VS code is the most popular IDE for development in Salesforce. I recommend installing the Salesforce plugging. It allows you to edit code in Salesforce, run specific queries, and write code that can be executed by Mule.

Anypoint Chrome Extension

The Anypoint Chrome extension allows you to get an environment ID, org ID, and access token from Mule. With this, you can also run API calls against the Anypoint platform APIs. You can get the extension here.

I hope this help you get started and I am open to any suggestions of information you would like to be added!

Loading comments...
You've successfully subscribed to Salesforce and Mule
Great! Next, complete checkout to get full access to all premium content.
Error! Could not sign up. invalid link.
Welcome back! You've successfully signed in.
Error! Could not sign in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Error! Billing info update failed.