Migrate from HubSpot to Salesforce this 2023

Migrating to Salesforce can unlock the power of advanced CRM functionality, enabling your business to optimize sales and marketing processes, improve collaboration, and drive growth. This article will explore why migrating from HubSpot to Salesforce can be a game-changer for your businesses, enabling you to achieve higher efficiency, scalability, and success. So let us tell you when, why, how, and more!

Key indicators that it's time to upgrade and transition from HubSpot to Salesforce

1. When business growth outpaces HubSpot’s capacity, struggling to keep pace with the expanding demands of upgrading to Salesforce becomes crucial.

2. In situations requiring advanced sales and marketing features, Salesforce provides a tailored suite of tools for enhanced efficiency and improved outcomes.

3. The need to integrate with a diverse range of third-party applications, systems, or tools has become more important as your business has grown in complexity.

Third party integrations Salesforce

4. When needing advanced reporting, analytics, and visualization features to gain deeper insights into sales and marketing performance, Salesforce’s powerful reporting tools and customizable dashboards can provide the necessary analytics capabilities.

Check out this recent HubSpot to Salesforce migration and customer testimonial.

Why Migrate from HubSpot to Salesforce?

Why Migrate from HubSpot, Zendesk, or any other CRM platform to Salesforce

Advanced Sales and Marketing Functionality

Salesforce empowers teams to enhance processes and achieve better outcomes. Businesses gain access to a comprehensive suite of tools and features specifically designed to drive sales and marketing success.

Customization and Scalability

A highly flexible platform that can seamlessly suit any business’s specific and unique needs. From customizing workflows and automation rules to designing personalized user interfaces, Salesforce allows your company to create a CRM system that aligns perfectly with their requirements and grows alongside your organization.

Integration with Business Systems

By migrating, companies can achieve a unified and interconnected infrastructure, enabling efficient data flow, automated workflows, and comprehensive insights across different departments and functions. This integration capability enhances productivity, data accuracy, and decision-making within the organization, ultimately leading to improved operational efficiency and customer satisfaction.

Robust Reporting and Analytics

With Salesforce’s advanced reporting functionalities, businesses can create custom reports and dashboards, track key performance indicators (KPIs), and gain valuable insights into their sales, marketing, and customer service efforts. Additionally, Salesforce’s AI-powered analytics tools, such as Einstein Analytics, provide advanced predictive and prescriptive analytics, helping businesses uncover hidden patterns, identify potential risks or opportunities, and take proactive measures.

Industry-Leading Support and Community

Whether troubleshooting technical issues, addressing implementation challenges, or seeking guidance on best practices, Salesforce’s support team can assist organizations throughout their migration and beyond.

Technical considerations to ensure a smooth and successful migration process

Migrating from one CRM platform to another requires careful planning and care of various technical aspects:

Data Audit

Organizations should conduct a comprehensive data audit to assess the quality, completeness, and accuracy of their existing data in HubSpot. This step helps identify any data inconsistencies or gaps that must be addressed before the migration.

Data Mapping and Cleansing

Analyze the data structure and fields in HubSpot and Salesforce to accurately map corresponding data during migration. Also, during this process, the consultant must identify any inconsistencies or discrepancies in data formats, naming conventions, or data types and address them before the migration.

Migration Tools

Choosing the right technology for migrating to Salesforce is essential to ensure a successful and efficient transition. It is important to carefully evaluate migration requirements such as data volume, transformation complexity, and loading speed to select the most appropriate tool. The correct choice can streamline the migration process, minimize errors, and optimize the performance of the final system in Salesforce.

Some technologies you can consider in this phase are:

Data Loader: Versatile tool that allows loading large volumes of data into Salesforce from various sources, such as external databases. It is efficient for massive migrations and offers advanced programming and automation options.

Data Import Wizard: A simpler and user-friendly tool is ideal for smaller migrations or less technical users. It enables quick and easy data loading from CSV or Excel files, although it has limitations regarding data volumes and customization options.

Bulk API: Powerful option for large-scale migrations. It enables loading massive amounts of data into Salesforce through batch operations, delivering optimal performance and increased efficiency in time and resources. Bulk API is beneficial when processing substantial volumes of data within a limited timeframe, as it leverages Salesforce’s parallel processing capability.

Data Security and Privacy

As a leading CRM platform, Salesforce adheres to industry best practices and compliance standards to ensure data protection. It is essential to define access controls and user permissions in Salesforce. Provides granular control over user permissions, allowing administrators to define roles, profiles, and data access settings to enforce data privacy.

Customizations and Workflows

Understanding the current configurations will help determine how they can be replicated or optimized in Salesforce. This evaluation includes identifying dependencies on specific features or functionalities in HubSpot and finding equivalent or alternative solutions within Salesforce’s ecosystem. During migration planning, it is essential to involve key stakeholders and subject matter experts from both HubSpot and Salesforce teams. This collaboration ensures a comprehensive understanding of the customizations in Salesforce.

Integration with Third-Party Systems

By evaluating the available integration options in Salesforce, such as pre-built connectors or APIs, businesses can identify the most suitable approach to seamlessly connect Salesforce with other business-critical systems. By taking a proactive approach and planning the migration of custom integrations, companies can minimize disruptions and maintain the integrity of data and functionality. 

User Training and Adoption

Knowledge transfer is key to your project. Developing a comprehensive training plan that familiarizes users with the Salesforce interface, features, and functionalities is essential. This plan should include various training sessions, documentation, and resources to help users adapt and maximize the new system’s potential. Salesforce partners like Oktana can significantly facilitate knowledge transfer during migration. They can provide expert guidance and training tailored to the business’s needs, ensuring users have the necessary skills to navigate Salesforce effectively.

Testing and Validation

It is crucial to set up a dedicated testing environment within Salesforce. This environment allows businesses to validate the migrated data, customizations, workflows, and integrations before the final migration. Establishing a structured testing plan covering various migration aspects is essential. This plan should outline specific test scenarios, expected results, and steps to reproduce issues.

Success Case Studies Migrations done by Oktana

High Tech company HubSpot to Salesforce Data & Process Migration

Our customer is a data analytics company that transforms complex data into valuable insights for business decision-makers. As the company expanded and added more processes, the complexity of the CRM grew exponentially, and leaders decided to migrate to Salesforce to increase usability and update all data. The new CRM would also require more functionality and customizations to include a sales management process.

Virtual Events Platform company CRM Migration to Salesforce

We partner with a global virtual event venue company that provides multiple interactive areas optimized for connecting and engaging. This start-up company boosted sales during the COVID-19 pandemic. They decided to change their CRM from HubSpot to Salesforce. This required migrating all their data to Salesforce and recreating all processes and workflows they were already using.

In a nutshell

The decision to migrate from HubSpot to Salesforce requires careful consideration and planning. While the process may pose challenges, it can be successfully executed while maintaining sales and marketing team productivity and ensuring a high data transfer success rate. Key factors include thorough team training on the new system, creating a detailed migration plan, and testing the setup before proceeding with the final migration. By carefully considering these factors and selecting the most suitable approach, your business can successfully migrate from HubSpot to Salesforce, unlocking the potential for improved sales and marketing operations within the organization.

At Oktana, we specialize in CRM system migrations and offer our expertise to guide you through decision-making and address any detailed questions. Schedule a meeting with one of our experts. 

Creating a Conversational Bot with ChatGPT, MuleSoft, and Slack

Can we create a fully functional conversational bot that leverages the power of a Large Language Model (LLM)? The answer is a resounding yes!

In this post, we’ll guide you through the process of building a robust and interactive conversational bot from scratch. If you have a fresh OpenAI account, it’s possible to utilize 100% free accounts and software since OpenAI gives us $15 of credit to try it. If not, you must add credits to your OpenAI account, but it’s inexpensive for this sample app.

We’ll use MuleSoft, Slack, and the state-of-the-art ChatGPT to make it happen. Unlike traditional NLP systems, ChatGPT is an LLM designed to understand and generate human-like text. This makes it extremely useful for various language-processing tasks.

So, buckle up and join us as we reveal the secrets to creating an intelligent bot that leverages the advanced capabilities of ChatGPT, an LLM that can enhance team collaboration and productivity, and deliver a seamless user experience. Let’s dive in!

Note: The accounts and software used in this post could have some limitations since MuleSoft gives us trial accounts.

The main purpose it’s that you understand and learn the basics about:

  • Implementation of OpenAI REST API (we’ll be using ChatGPT-3.5-turbo model)
  • How to create a simple backend integration with Anypoint Studio.
  • How to realize an integration with Slack.

Pre-requirements

  • Anypoint Studio’s latest version.
    • Once you installed Anypoint Studio and created a new Mule Project, we need to install the Slack Connector, you just need to access the Anypoint Exchange tab, and then you will be able to search for and install the connector.
  • Anypoint Platform trial account, you can create a 30 days trial account.
  • A Slack Bot installed on a Channel.
  • An OpenAI account with available credit. Remember, OpenAI gives us $15 if it’s your first account. If you previously registered on the OpenAI platform, then you will need to add a balance to your account. However, following this guide and creating your sample application, will be really cheap.

Once we have everything installed and configured, we can proceed with getting the corresponding authorization tokens that we will need along with our integration. Save these in your mule-properties .yaml file.

OpenAI API Key

Once you have created your account on OpenAI, you will be able to access your account dashboard, where you will see a tab labeled “API Keys”. Here, you can generate your secret key to make requests to the OpenAI API. Simply click on “Create new secret key”, copy the key, and save it to a text file.

Slack Oauth

On your Slack application, you should have already configured your bot inside a channel on Slack. If you don’t know how to do it, you can follow this guide. On Bot’s scope configuration, enable ‘channels:read’, ‘chat:write:bot’, and ‘channels:history’. 

This screenshot it’s an example of how looks the interface, you will have your own client ID and Client Secret:

Configuration properties of a Conversational Bot

You can use this sample file for your mule-properties .yaml file, you just need to replace your own KEYS and IDs.

The Integration

Now that we have our Bot created in Slack, and our API Key on the OpenAI dashboard, you start getting an idea about the roles of each system and which is the missing piece that connects them all, that’s right, it’s MuleSoft’s Anypoint Platform.

The Project Structure

The project is divided into a main flow, and 3 flows, divided according to functionality. We need to do some things between receiving and replying to a message from a user on Slack. Please see the image below, and each block’s explanation.

Main Flow

  1. This Mule flow listens for new messages in a Slack channel using the slack:on-new-message-trigger component. The channel is specified using the ${slack.conversationId} property. A scheduling strategy is set to run the flow every 5 seconds using the fixed-frequency component.
  2. Next, the flow checks if the message received is from a user and not from the bot itself. If the message is from the bot, the flow logs a message saying that it is the bot.
  3. The incoming message is then transformed using the DataWeave expression in the Transform Message component. The transformed message is stored in the incomingMessage variable, which contains the user, timestamp, and message text. 
    • If the message is from a user, the incomingMessage.message is checked to see if it equals “new”. If it does, the finish-existing-session-flow is invoked using the flow-ref component. If it doesn’t equal “new”, the check-session-flow is invoked with the target set to incomingMessage.

Overall, this flow handles incoming messages in a Slack channel and uses choice components to determine how to process the message based on its content and source.

The finish-existing-session-flow and check-session-flow are likely other flows in the application that handle the logic for finishing existing sessions or checking if a new session needs to be started.

Finish existing session flow

  • “Finish-existing-session-flow”: terminates the previous session created by the user.

Check session flow

This flow called “check-session-flow” checks if a user has an existing session or not, and if not, it creates one for the user. The flow follows the following steps:

  1. Check if a user has an existing session: This step checks if the user has an existing session by looking up the user’s ID in an object store called “tokenStore”.
  2. Check array messages user: This step checks the object store “store_messages_user” to see if there are any messages stored for the user.
  3. Choice Payload: This step uses a choice component to check if the payload returned from step 1 is true or not.
    • When Payload is true: If the payload from step 1 is true, this step retrieves the existing session ID from the “tokenStore” object store and sets it as a variable called “sessionId”. It also retrieves any messages stored for the user from the “store_messages_user” object store and sets them as a variable called “messageId”. Finally, it logs the “messageId” variable.
    • Otherwise: If the payload from step 1 is not true, this step sets a welcome message to the user and stores it in the “store_messages_user” object store. It generates a new session ID and stores it in the “tokenStore” object store. Finally, it sets the “sessionId” variable and generates a welcome message for the user in Slack format.
  4. At the end of the flow is where we interact with OpenAI API, calling a flow named “make-openai-request-flow”.

The steps in this flow ensure that a user’s session is properly handled and that messages are stored and retrieved correctly.

Make OpenAI request flow

The purpose of this flow is to take a user’s message from Slack, send it to OpenAI’s API for processing, and then return the response to the user via Slack. The flow can be broken down into the following steps:

  1. Transform the user’s message into a format that can be sent to OpenAI’s API. This transformation is done using DataWeave language in the “Transform Message” component. The transformed payload includes the user’s message, as well as additional data such as the OpenAI API model to use, and a default message to send if there is an error.
  2. Log the transformed payload using the “Logger” component. (Optional, was used to check if the payload was loaded correctly)
  3. Send an HTTP request to OpenAI’s API using the “Request to ChatGPT” component. This component includes the OpenAI API key as an HTTP header.
  4. Store the user’s message and OpenAI’s response in an object store using the “Store message user” component. This allows the application to retrieve the conversation history later. (please read more about this on OpenAI documentation. This will help to keep the conversation context that a user has with ChatGPT since messages are stored with roles: “user” and “assistant”.).
  5. Transform the OpenAI response into a format that can be sent to Slack using the “Make JSON to send through Slack” component. This component creates a JSON payload that includes the user’s original message, the OpenAI response, and formatting information for Slack.
  6. Send the Slack payload as an ephemeral message to the user using the “send answer from chatGPT to Slack” component.
  7. As the final step, we delete the original message sent by the user, as we are using ‘Ephemeral messages’, since the Bot is deployed on a channel, the messages are public, with ‘Ephemeral messages’ we can improve the privacy on the messages sent on the Slack channel.
    1. Create a payload to delete the original message from Slack using the “payload to delete sent messages” component.
    2. Send a request to delete the original message from Slack using the “delete sent message” component. 

By following these steps, the MuleSoft application can take a user’s message from Slack, send it to OpenAI’s API, and return the response to the user via Slack, while also storing the conversation history for later use.

This was created and tested with these versions:
Mule Runtime v4.4.0
Anypoint Studio v7.14
Slack Connector v1.0.16

Why you should Integrate Shopify with Marketing Cloud

Choosing the right platform to build your online business is a very important decision to make. Power technology infrastructure must be integrated into your site to support the customer buying journey and drive your customers toward a conversion. Integrating Shopify with Salesforce Marketing Cloud will help your business increase customer engagement, provide a personalized experience, and much more benefits that will help you generate conversions and optimize the journey of your customers.

How does it work?

In order to integrate Shopify and Marketing Cloud, you will need MuleSoft, to help exchange customers, products, and order data between both platforms. A tracking code is installed in your Shopify store that syncs product views and other actions taken in your store with Marketing Cloud. This allows you to generate reports, send customized emails throughout the entire shopping cycle, and have a 360-degree view of your customers so your team can create a more personalized experience, resulting in more engagement, more sales, and less investment.

overview shopify and salesforce marketing cloud demo

Benefits of the Integration

Personalized Shopping Suggestions Powered through Einstein AI

Every time your customer creates a Shopify account, they’re automatically added to your database so you can decide (depending on their behavior) the best email campaign or flows to include them in.

For example: Bob creates an account in your company’s online store and then he made a purchase. Now he receives a personalized order confirmation email with the details of his purchase and additional product recommendations based on his shopping interests.

These product recommendations are generated through Einstein AI, with customer data such as previous purchases, browsing history, and other significant shopping patterns.

Abandoned Cart Reminders Personalized with Shopify Data

With this integration, your customers can receive a customized email whenever they added products to their shopping cart, but didn’t complete the purchase. This feature allows you to configure personalized flows, so you won’t have to worry about losing a sale. Simply set up the amount of time you wish to remind your customers about their pending shopping carts, and the email will be automatically sent from Marketing Cloud.

Create Custom Marketing Campaign Flows

With Marketing Cloud, you can easily create and customize marketing campaign flows to reach your customers throughout different stages of the buying cycle. As mentioned above, you can create flows for abandoned shopping carts and email purchases. Flow can also be configured for newsletters, sales promotions and whatever email marketing approach fits your strategy.

How does a Guided Send work in Marketing Cloud?

  1. Create the email template and define your audience.
  2. Select the data extension option so you’re able to send an email to all of your target audience.
  3. Finally, select the email address from which the campaign would be sent
    Just follow these three simple steps, and you too can send email campaigns to your selected Shopify subscribers.

Track Success in Real-Time with Marketing Cloud Dashboard

With the Marketing Cloud dashboard, you get all the information you need to track the success of your campaigns in one centralized dashboard. With this integration, you and your team can access real-time performance results and statistical Shopify data for all of your campaigns on every email sent.

Some of the information you can access includes:

  • Behavior: clicks, forwards, and purchases.
  • Conversions and new subscribers
  • Email Activity: analyze which section performs better based on real-time results.
  • Delivery Data: number of emails sent and bounce rate
  • Engagement Data: open rate and click-to-open rate
  • Email Performance Data: conversion funnel and engagement distribution
  • Insights on best-performing emails, subscriber journeys, and engagement histories

Is this something you or your company need?

We have a team of experts ready to help you. Our technical team has partnered on multi-product, cross-cloud integrations with over 8 years of experience building on the Salesforce platform. We are experienced and confident in implementing third-party integrations. We can connect any application, technology, or system to Salesforce.

If you have any doubts about this integration being the right fit for your organization, don’t hesitate to contact our Sales team at [email protected] for more information.

Salesforce Integration Best Practices

Index

What can we do to avoid a Salesforce integration failure?
THIS is the problem behind this article.

A lot of investment goes into a system integration, such as money, time, planning, and strong expectations. Salesforce has over 2,500 integrations and applications available to make your life (or your customer’s life) easier. So why not take advantage of it in the best way possible?

In this article, you will learn how to manage your integration in the best way possible by handling all major factors and acknowledging the Want to avoid a Salesforce integration failure? We will show you how to manage all factors behind Salesforce Integrations Best Practices.

Basics

First, let’s go back to basics. What is an integration?

A Salesforce integration happens when two or more systems come together through a process that facilitates functions or procedures that were once separate. By doing so, all their data is easier to handle by means of multiple, now connected, processes and systems running hand in hand.

Think about it for a second. It’s quite weird to find a system nowadays that is fully isolated.

Dealing with integrations is an essential part of a Salesforce technologist’s job. Hence, becoming skilled in this process means performing the integration faster, with little to no errors, while recognizing that the systems should stay ​​malleable and accessible to other future integrations.

Did you know?

An essential part of any integration is the famous API, an Application Programming Interface. The API is essential because it works as a software intermediary between the applications to communicate with each other.
Without it, there would be no interaction and integration between the systems.

In order to build a good integration and have it perform to the best of its ability, you need to consider all the factors that affect its proper functioning. There are many, but for this example, we will highlight timing. To put it simply, be certain that your processes run to a suitable clock. Whether you choose a synchronous or asynchronous one, would depend mainly on the integration type.

And to help you remember how they work here is a graphic to keep handy…

Security Comes First

As it should be, security is one of the most important factors when it comes to Salesforce integrations. Plenty of factors affect security, but what matters most is taking care of what may have undue access or even harm your integration pattern, your data, as well as your customer’s data. Security elements that typically manage firewalls, forward proxy, reverse proxy, encryptions, and the WS protocol, prevent your system from being invaded by harmful disruptions in the following ways:

  • Countering attacks
  • Managing your sensitive information
  • Protecting your online identity
  • Handling authentications
  • Throttling

Even with all their help, security measures are still number one in our list of best practices and should be counted as primary for each individual project. Brushing them aside as a routine step should be avoided at any cost. For more information, consult security considerations.

Salesforce Integration Patterns

Salesforce patterns and the requirements behind your project, go hand-in-hand. Therefore, patterns need to be carefully understood to handle them better. Makes sense, right? 

Before going ahead, think about timing, direction, security measures, and anything else that impacts their correct functioning. To learn more about patterns, their type, timing, and patterns to consider, consult the Salesforce Pattern Selection Guide.

Now that you have a better understanding of what patterns are, let’s go over some simple factors and the questions affecting each.

  • Since Salesforce needs to perform processes based on the response it receives, the first factor to consider is keeping track of transactions being followed.
  • Timing, as mentioned previously, is also an important factor. Check if it should be synchronous vs asynchronous. Do the processes need to be in real-time vs near real-time?
  • Ultimately, there are a few other elements to manage, such as integrating declaratively or not, the size of your message, how to protect against unforeseen situations (ex. your external system going down), and all matters related to the Salesforce contract.


The platform being used can also be a factor that alters patterns and integrations. We recommend using MuleSoft. You can design, build, customize, and integrate your APIs faster thanks to its one-in-all platform that also allows testing, grants you pre-build assets, and lets you discover more APIs to expand your reach. There are other resources like Informatica and Jitter that should also work nicely. However, MuleSoft is a formidable contender in terms of data management, customization, and customer experience. You won’t be disappointed.

Common Mistakes

From not handling the scope of your project, to losing sight of all the requirements –  it’s human to miss the beat and lose track of what is really at stake. Keeping track of things can save you time, money, and stress. We know you know this, but it’s never a bad idea to have some useful reminders. 

Here you’ll find some tips to make your life easier and avoid common yet foreseeable mistakes… 

Check your to-do list.

  • Before getting started, be mindful of activating and deactivating the corresponding components. Improper activation may disturb both your implementation and your team’s workflow.
  • Pay attention to workflows, triggers, as well as conflicts and discrepancies with mapping data fields, types, and structures. 
  • Be careful not to duplicate worthless data. Do the dishes! Have everything neat and ready before and after integrating your systems. 
  • Choose the right system architecture. Take your time to select the right system since it is a crucial decision that may cost you more in the long run. 
  • Check if you need to consider any future customizations that will influence key decisions, such as the integration type, pattern, security measures, and others specific to your implementation. 

Don’t lose track of things.

  • This may sound obvious, but having a clear idea of what you’re about to implement will always be the first step to take into account.
  • Be mindful of objectives and priorities that may save you from having to go back and start over from scratch. 
  • We recommend asking for help from a consultant if necessary. Help is never a bad idea.
  • Whoever is responsible for implementing the integration needs to be mindful of every activity, commit, and comma –  in order to avoid serious problems in the long run. 
  • Whenever there is a need to change or customize your work, be sure to keep things in order and your documentation will become a lifesaver. 
  • Keep in mind that Rome wasn’t built in a day. Your integration will go through phases that can be thwarted by early avoidable mistakes.

Summary

After understanding the importance of what an integration really is, and the role of the API behind it, we know that security comes first. The security elements that typically manage tools like firewalls and proxies have a crucial role to play and shouldn’t be left aside. 

Choosing the right pattern, architecture, and platform is also important. They all influence each other. Any integration is different in itself and should be respected as such. 

Finally, remember that checking your to-do list and keeping track of things will save you lots of headaches down the road. Try to maintain everything as neat and sorted as you can, from activating and deactivating components, to managing documentation and your integration’s lifecycle.

At Oktana, we’re both Salesforce and MuleSoft partners, skilled at Salesforce integrations, including Heroku and Slack. With certifications across a wide range of Salesforce products, in addition to products like Informatica and MuleSoft, we can connect any app or system to the Salesforce ecosystem.

If you’re in need of a consultant to help expand your current resources and augment your team, don’t hesitate to contact us. Our team of Salesforce experts is here to help support your project.

Further resources

Dreamforce 2022: A Guide of What to See & Do

September is almost here, and Dreamforce is just around the corner! The Oktana team will be attending this year, so we’ve been keeping ourselves busy preparing for it with much anticipation.

This year marks the event’s 20th anniversary, and the theme they’ve selected reflects the significance of this momentous achievement: “Go Big and Come Home”.

It will be held at its regular venue, the Moscone Center in San Francisco, from September 20th to the 22nd.

Dreamforce 2022: A Guide to What to See & Do

Why Attend Dreamforce 2022

Dreamforce brings together thought leaders and industry pioneers for a week of idea sharing. You’ll learn, you’ll network, and you’ll grow. And most importantly, you’ll have a ton of fun.

Here are four reasons why we love attending Dreamforce so much…

1. Learn: Dreamforce will have over 1,000 sessions and workshops this year, learn about new products and releases, have hands-on experiences, and get inspired. This is the ‘World’s Largest Software Conference’ after all.

2. Connect: It is the perfect place to meet new people, build careers, and completely transform your career by networking.

3. Give Back: Salesforce is all about Philanthropy, Dreamforce couldn’t be different. By attending Dreamforce, you’re giving back too. Over the years, over $100M has been raised and donated during Dreamforce to a variety of charities and communities.

4. Have fun: When Trailblazers get together, it’s a party. And Dreamforce is the biggest one of all. Dreamforce is a celebration of the community. And this year, the Red Hot Chili Peppers are performing live!

Who is going to be there this year? 

  • Tens of thousands of like-minded Trailblazers from around the world.
  • The Red Hot Chili Peppers! 
  • World celebrities, activists, and athletes 
    • Bono | Lead singer of U2; Co-Founder of ONE and (RED)
    • Jennifer Hudson | Emmy, Two-Time Grammy, Oscar & Tony Award-Winning Artist
    • Matthew McConaughey | Academy Award-Winning Actor, NY Times Bestselling Author & Salesforce Brand Partner
    • Earvin “Magic” Johnson | NBA Legend and Chairman & CEO of Magic Johnson Enterprises
    • Simu Liu | Actor & Writer
    • Dina Asher-Smith | Two-Time Great Britain Olympian
  • Salesforce Chair & Co-CEO Marc Benioff and Co-CEO Bret Taylor

Recommended sessions

The Dreamforce agenda has been released, and great content will be available for all kinds of roles, products, industries, and more. So, how do you ensure to get the most out of your experience? 

Take a look at these curated lists of Dreamforce sessions we recommend attending based on your role…

Recommended sessions for developers dreamforce
recommended sessions for designers
recommended sessions for admin & architecs dreamforce

See you in San Francisco!

This year we will be attending Dreamforce. We booked a meeting room nearby the Moscone Center (see the map below), so you can meet the Oktana team and chat about Salesforce technologies, languages, and frameworks to enable your company’s innovation.

Interested in setting up an appointment to meet with someone from our team during Dreamforce? If yes, then follow this link to select a time that’s convenient for you.

Here’s the Details…

Where: Mindspace | 575 Market Street @2nd

When: September 20-22 | 10 am – 5pm

Amenities & swag:

  • Lounge spaces with phone booths
  • Kitchen with coffee, water, tea, fruit, and sweets
  • Custom knit socks
  • Webcam covers
  • We’re ordering dozens of freshly baked alfajores as a way of sharing our company’s South American culture with those visiting our meeting space
 
Oktana team attending Dreamforce:
  • Jaime Solari | CEO
  • Marcos Solari | Co-Founder
  • Dennis Picht | CRO
  • Christine Burnham | VP of Sales
  • Jon Parker | Strategic Account Executive
Meet Oktana at Dreamforce
Oktana at Dreamforce

Salesforce TDD (Test-Driven Development)

Hi, I’m Diego and I have several years (I prefer not to say how many, but let’s say “enough”) working in Salesforce. I am also an Agile enthusiast and lover of applying related techniques throughout my work.

I’ve found test-driven development (TDD) can be a great technique for building robust software, but when we work in Salesforce, I find some constraints or restrictions can make it frustrating. In this post, I’m going to show when and how I use TDD while coding in Salesforce.

Disclaimer: The following is written on the basis of what has worked for me in the past. This is not intended to be a formal or exhaustive description. Use it as you see fit, I do not take any responsibility if you screw it up! 🙂

Salesforce TDD (Test-Driven Development)

Let’s start at the beginning:

What is TDD?

TDD is an Agile development technique that requires you to write a failing unit test before writing any “production code.”

How are you supposed to do TDD?

First I’ll describe how TDD is done in general (this is the way to go in languages like Java).

  1. Write a unit test and make it fail (a compilation error is considered a failing test). Write no more lines of code than needed.
  2. Write the least possible production code lines to make the test pass (fixing a compilation error is considered a pass test).
  3. Refactor the code.
  4. Repeat until you are done.

Let’s check out an example in Java so you see how it works. In this example, we wanna create an advanced calculator of integers.

 

We work in split view when doing TDD

Round 1

Let’s write a failing unit test:

Oops, MyCalculator is not defined yet, compilation issue…therefore, it is a failing test.

Let’s make the test pass:

Compilation problem fixed! The test is passing again. Woohoo!

No tons of code to refactor. 

Round 2

Let’s continue with that test to make it fail again.

Mmm…getOpposite is not defined, ergo compilation issue, ergo failing test.

Let’s fix that. Let’s write the minimum code to fix the test:

getOpposite is defined and returns 0 to any parameter (in particular, 0). Test is passing again!!!

Let’s refactor.

We still don’t have much code to refactor, but there are some name changes we could use to make code easier to read ( yup, yup, yup…unit test code is code, too).

Much better now! 😀

Round 3

Let’s add a new minimum test to fail.

Right now, getOpposite returns 0 to any parameter… it’s a fail!

Let’s write the minimum code required to make the test pass.

Yay! It’s green again! Let’s continue.

Round 4

Let’s add a new failing test.

Last test fail (we are return 0 to any value different than 1), so now we need to write the minimum code to fix this test:

Test is passing again… but this solution is not good, let’s refactor.

Tests are still passing and we solve all the cases! We are done! Well, not actually, we still need to document, test more, write more tests and write even more tests…but we’re on the right path.

I expect this silly example gives you a feel for what TDD is and how it is done.

Now, let’s continue with the discussion, focused on Salesforce.

TDD Advantages

  • Code coverage: We get great code coverage without even thinking about it.
  • Testability: The code is designed to be testable by default (we are actually testing every time we change something).
  • Easier to refactor: We should not change or refactor code without having a set of tests we can lean on. As we are constantly writing tests that we know are able to catch bugs (we make it fail at the beginning), we know that we have a set we can rely on.
  • “Better” code: We are constantly refactoring the code, striving for the best possible code.
  • Predictability: After we finish a “round,” we are completely sure the code is working as we designed it to work and we know we didn’t break anything. We can say we have “working software.”
  • Prevents useless work in Salesforce: In Salesforce, aside from Apex, we have plenty of options to make changes like triggers, workflow rules, process builder, etc. Imagine that after we write a test that changes a value on a contact record, it passes. We could discover that there is another moving part that is taking care of that change (or we wrote the test badly).
  • Documentation: Tests are a great tool to communicate with other developers (or the future you) how, for example, a class API should be called and the expected results of each case.

TDD Disadvantages

  • Overtrust: It happens to me that, as we are testing continuously and we are getting test green, I sometimes have a feeling that the code is working perfectly…but it doesn’t mean it is. We may miss, or simply get lazy, and leave a case out of the unit test.
  • Slow in Salesforce: TDD is designed based on the theory that compiling or writing a test is really fast (a jUnit unit test has to run in less than 1ms). In Salesforce, we need several seconds to compile (the code is compiled on the server) and several more seconds to run the test. In my opinion, this is usually 10+ seconds. As we are compiling and running tests constantly, we add several minutes of “waiting for Salesforce.” However, this can be mitigated if you think you will need to write/compile/execute tests later anyway – you might as well do it upfront.

 

 

Me when I realize the QA found a case I had not considered when I was doing TDD

I will (probably) use TDD when...

In general, I’ve found that TDD is a great tool in several circumstances and I tend to do it almost always in the below cases.

  • Back-end bug fixes: Doing TDD in this context has two big advantages. First, you make sure you are able to reproduce the bug consistently. Second, and even more important, as you are writing a test specific to the bug, you know you will never introduce that bug again.
  • Back-end work with clear requirements and a clear implementation strategy: In this context, writing tests is going to be easy and implementing the production code will be easy, too, as you know where you are heading when you create the test cases.
  • Back-end work with clear requirements and minor implementation unknowns: In this context, the test is easy to write and the production code may be getting clearer as you move into cases.
  • Back-end work with some requirements discovery: Imagine in our calculator example you write a test to divide by zero and you realize you’ve never discussed that case with the BA. TDD helps you discover opportunities to clarify requirements.

I might do TDD, but it’s unlikely...

  • As part of requirements discovery: You could write unit tests as part of requirements discovery, and discuss it with your stakeholders, BA, or other technical people, but you probably have better techniques to support this process.
  • Front-end work: I’m gonna discuss this briefly later, when we talk about Lightning web components.

I will never do TDD when

  • I’m doing a prototype: By definition, a prototype or PoC should be discarded after we show it, so I code it as fast as I can, focused on demonstrating the core functionality.
  • I’m experimenting: If I’m trying a new idea, I don’t focus on code quality (again, this is a prototype).
  • I’m evaluating implementation options: There are some cases where you want to compare two implementation options, so focus on having a good-enough-to-decide prototype and throw it away after you decide…then do the stuff well.
  • I don’t care about code quality: I know code quality is not usually negotiable, but in very limited and extreme situations, it may not be the top priority. For example, when everything is screwed up on prod and you need to fix the problem ASAP because the company is losing millions of dollars per minute. In this very extreme circumstance, fix the problem as fast as you can, make your company earn money again, go to sleep (or maybe get a drink) and tomorrow at 10 am (yup, after a stressful night, start working a little later the next day) make the code beautiful with TDD. Make a test that reproduces the bug and then fix and refactor the code properly.

 

 

Me again, but on one of THOSE nights.

  • When creating test code is extremely difficult (but not possible): In Salesforce there are a few elements that are very hard to test, like working with CMT. In this scenario, I’d probably split the problem into two parts – one that is TDD-doable using mocking data (@TestVisible is your best friend here) and a second, smaller part that I’d consider how to test later (if I even consider it).

How I do TDD in Salesforce

I really don’t do TDD as I defined at the beginning of this article when I’m working in Salesforce. Why? Mainly because of the slower compile/test flow, but also because in Apex we generally start writing integration tests instead of unit tests. Instead of “regular” TDD, I tweaked the formula a bit to work better under Salesforce circumstances.

  1. Write an entire deployable test that checks the flow or use case. Yup, I said deployable, so if I called a method I haven’t created yet, I will create it, empty, so I can deploy.
  2. Run it and get a failure.
  3. Write the minimum code that makes that test pass.
  4. Refactor.
  5. Continue with the next flow or use case.
  6. When I’m done with all the flows and use cases, I refactor the code again (splitting methods, checking code cleanliness, documentation). I run the unit test continuously, every few changes to check if everything continues to work as expected.

To make everything clear, let’s view an <could-be-real-world> example.

Requirement:
As a user, I want the values stored in any object copied into a number of specified contact fields. The specified “mappings” will be stored in a CustomMetadataType called Contact_Mappings__cmt. The Contact_Mappings_cmt has two fields:

  • Original_Fields__c Text
  • Mapped_Fields__c Text

Round 1

As I said before, I should start writing an Apex test that tests a business case. The first thing I’m thinking of developing is “The contact should not change if there is no mapping defined.” I have to write a deployable test that is going to fail with the minimum amount of code to make it fail:

We work in split view

As expected, the code deploys but the test fails. So, we need to fix it! We can simply return the same object.

Now It passes, but we don’t have a lot of code to refactor (we could extract some constants in the test).

This is a much better test.

Test still passes!

Round 2

Okay, let’s add another case. What if we check that the User.LastName is copied into the contact when I define the Mapping Lastname => Lastname? Great idea, let’s do it!

I start to write the unit test but…. I realize I can’t do an Insert in a CMT. Or, I give seeAllData permission to the test and define it in the project metadata. Or, I have to somehow deploy it. 

Remember that I said that I don’t do TDD when writing the test is extremely hard? Well, it looks like I’m in one of those situations. At this moment, I can quit writing this blog post and go cry…or I can redefine what I am developing with TDD, leaving all the complexities outside of scope. I imagine you would be very annoyed after reading this far to see me just quit, so let’s go with the second option.

I can’t use the CMT right now, so let’s do something different. What if we use a Map<String, String> where the key is the field in the original object and the value is the list of fields names in the Contact Object. It might work, later on we just need to read the CMT and create a Map with that information, but spoiler alert…that won’t be covered in this article.

But okay, great, let’s create a map and write the deployable failing test.

And as it was expected… it fails.

Let’s write the “minimum” code that makes that test pass

Our new test passes, but the other one failed! Let’s fix that.

Let’s do some refactoring, either in test or production code.

I think the put/get part is messy to read (and has its own meaning), so let’s split it into its own method.

Also, as we want that theMap could be injected into test case scenarios, the @TestVisible annotation is useful here.

Round 3

Now we should add a new test that executes a new flow and see it fail. I think you got the idea, so I won’t do it now, but just to specify the cases, I can think:

  • Mapping a field to multiple fields (separated by colon)
  • Does nothing if origin field is wrong
  • Does nothing if destination field is wrong
  • Does nothing if types are not compatible
    …and so on

Can we do TDD in Lightning web components (or front-end)

The short answer is yes, we can.

Long answer: As the Jest test can’t see the objects, but they see only the “generated DOM”, it may be harder to do TDD in an efficient way for front-end solutions. Usually, it is better to test visual code by watching the result and THEN write the tests we need to ensure code won’t break in the future.

Conclusion

TDD is a best practice that’s good to master so that you can decide the best moment to apply it (I don’t believe there is One Ring to rule them all, One Ring to find them, One Ring to bring them all, and in the darkness bind them, thank you J.R.R. Tolkien). Applied correctly it will make you produce better, more robust code…and fewer bugs, which means…

Homer is happy

Salesforce System Architect: Tips, Role, and Responsibilities

 

Interested in becoming a Salesforce System Architect, but still have some questions about it? Travis, a System Architect in our West Virginia office, has the answers.

Is the Salesforce recommended material enough to prepare me for the Salesforce System Architect Certification? 

Yes. I think that in the beginning, it may be a little overwhelming. Make sure you understand the content well and don’t get discouraged. If some of the details seem like a little too much to memorize, just have a general understanding of everything. If you have excellent general knowledge, you should be okay on the exam. Some of the exams do get more specific than what you would ever actually need in a working situation, like the Identity and Access Management Designer exam in particular. So there are some things that you have to memorize, but I think that if you have a good understanding of all the content, you should be okay.

 

Is the System Architect certification a prerequisite for another certification, or is it the end of the career path?

                                               Source: Trailhead Architect Overview 

The next step for a Salesforce System Architect is to become an Application Architect and then a Technical Architect. For the Salesforce System Architect and Application Architect, you need to pass four exams per certification. Once you get the certifications, you’re considered either a System Architect or Application Architect, depending on your achievements.

Becoming a Salesforce Certified Technical Architect (CTA) is a little bit different. There isn’t an exam as far as questions and answers that you go online to take. It’s actually like sitting in front of a board of people who have achieved the Salesforce CTA. They ask you questions about the solutions you present and then decide whether you should be a CTA as well.

Do you recommend following some particular order for the certifications?

I recommended starting with Salesforce Platform Developer I certification to understand the basics of Salesforce. They’re so specific compared to the other exams, so it is better to start with that one. Also, none of the other certifications build on the other. All three are separate topics.

How long does it take to become a certified Salesforce System Architect?

It depends. Things were a little different for me. It took me one year, which is probably a little unique. Salesforce says it typically takes three to five years and requires working with the Salesforce platform. But I kind of jumped through things a little bit as I didn’t have to learn much about the background and best practices because I already had experience with that. In my case, I was just learning the Salesforce platform and how to put that together with my experience. It’s going to depend on how much time you have to study, and what your regular work is. If your regular job involves many things related to the exam, you’re going to gain that knowledge more quickly. It just depends on your situation.

What other certifications or technologies would you recommend learning to be a well-rounded Salesforce architect?

As far as the certifications and Salesforce go, there are Certified Consultant certifications for different areas like Sales, Service, and Experience Cloud. You can get those and obtain a deeper knowledge of Salesforce and the technologies they offer. 

The MuleSoft certification is something I’ve seen a lot about lately. I’ve been studying MuleSoft quite a bit because many customers and Salesforce team members are using it. I recommend learning anything popular with your customers and your work area.

The big thing is just having a perfect understanding of the Salesforce platform and the fundamentals because you can apply those fundamentals to anything the customers need. 

Did you use other materials besides Trailhead from Salesforce?

I did for a little bit right before I took the exam. I looked at some practice exams just to know what I should expect. I found some excellent pages but others were out of date. You have to be careful, there is lousy information floating around that can encourage you to make mistakes.  

Some useful resources:

What makes a good Salesforce System Architect?

If you want to become a good Salesforce System Architect, you need to:

  • Understand the customer’s requirements and how to translate those into actual functional tasks.
  • Be able to work with others. Most of the time, architects are almost consultants within a company. You’re not just going to start a task, then sit back and work on it in isolation for a month. You need to be directly involved.
  • Communicate well. Whether it’s the people on your team or your customer, you need to learn how to give the best advice in a way they understand.
  • Have patience. Never jump into things too quickly. Always take your time and investigate. It’s okay to have questions. In those situations, it is better to say: ‘I’m going to do a little research. And I’ll get back to you.’

    If you want to learn more, we highly recommend going over these two resources:

Becoming a Salesforce System Architect

Have you become a Salesforce Certified System Architect yet? Travis has and he did it in an impressively short amount of time, so we asked him to share his experience. Before we jump into it, let’s get some background on Travis and learn more about him. 

  • He worked with .NET applications for about seven years.
  • Likes Salesforce’s certification paths because you can show your prior knowledge.
  • Changed his career path by complementing his prior knowledge with Salesforce.
  • Has been working with Salesforce for about four years.
 

Challenges to becoming a Salesforce System Architect, Developer, Designer, Architect?

Challenge Accepted

 

Switching to a new career path can be daunting. That’s why we asked Travis what challenges came along with the process of getting these certifications.

Whenever we start something new, there is a certain level of anxiety or fear. This situation, though expected, can hit us like a cold shower at 5 am. This is all part of the process of going in-depth on a new topic. Working with new information also opens up a new area to explore, requiring the necessary amount of research behind it. One of the main challenges Travis found is when working in areas where you have no past experience or you don’t yet know the basics. These areas bring more interesting challenges. 

I just had to spend a lot of time learning Salesforce well, before I moved into the more in-depth topics

Travis. Oktana Salesforce System Architect

For some people, time management is not an issue. But for us mortals, this may not be the case. Becoming a Salesforce System Architect will take a bite out of your daily routine and that will be an adjustment. This makes sense because most people work and study at the same time. Travis emphasizes the importance of staying motivated and finding the time to study.  Especially if you work in a different area where you are developing different skills. 

Set aside some time every day to go through the Salesforce recommended material

Travis. Oktana Salesforce System Architect

The path seems pretty simple, right? We start with Salesforce Platform Developer I Certification to get a handle on all the basics, then we continue onwards! One key point to remember though is not to get ahead of things. Each module deserves time and attention. It may seem intuitive to go into the nitty-gritty or jump ahead. However, you could bump into uncharted territory down the line, which may derail or put a stop to your master plan, and nobody wants that. That’s why Travis reminds us to give ourselves some space and take the time we need to work through each of the modules.

Focus on one area or topic at a time. It could get a little more confusing if you don’t.

Travis. Oktana Salesforce System Architect

Valuable Resources to become a Salesforce System Architect

Salesforce’s learning platform, Trailhead, helps you accelerate your digital transformation. The System Architect Certification consists of four different certifications, each with its own trails and trailmixes to help guide you. As was previously mentioned, Travis recommends completing the Platform Developer I Certification first,  then going on to the other three. These trails are hands-on guides with examples that allow you to experience what you’re working on. There is also plenty of documentation and other resources. On top of that, the gamified experience will surely help you keep motivated. On the whole, the trails, plus all the other resources, can be overwhelming at first. That’s why keeping calm and studying as much as you can before the exams are your best bet. 

Travis loves the data and seeing what works best. What about you? To get an idea of which module you are most interested in, here is a short description of the modules coming after the Platform Developer I Certification. You will also get an example of how to go about taking the exams. This was the path Travis followed. Let’s see if this works for you!

  • Integration Architecture Designer: This certification is more about active learning. Travis mentions following the recommended material. And he also highlights that general best practices were useful along with his prior experience and knowledge. The exam focuses on a specific scenario, where you’ll have to understand the requirements of the customer. This depends on the apps and data your customer needs and how they should be evaluated and handled. 

  • Identity and Access Management Designer: This certification gets more challenging. Experience in this area is a big factor. The exam focuses on details, configuration, and authentication. It’s all a matter of learning new concepts that will broaden your skills. Travis also points out that the customer and their technologies come into play and influence your decision-making process. Understanding the relationship between the customer and Salesforce is a must.    

  • Development Lifecycle and Deployment Designer: Woohoo! We’re here. This one focuses on the development lifecycle. From development to production and testing, you will go through the methods and steps behind it all. Travis reminds us that the process will inevitably be linked to the customer’s needs. Again, the key is to find the best fit for the customer. 

A Day in the life of a Salesforce System Architect

Now you have an idea of how to tackle the certification, we also asked Travis what his daily work looks like. He shared that his actual work is similar to the exams. Good to know, right? Knowing the customer and their requirements is always a must. To do this, strong communication and learning how to ask the right questions are definitely game changers when it comes to dealing with customers. The following is a sample of questions you might ask yourself, he says:

Do we already have a lot of existing applications accessing them?

How do we need to sync all these things in real-time?

Travis. Oktana Salesforce System Architect

In a Nutshell

Here are some of the best tips to remember:

  • Prior knowledge and best practices can be really helpful.
  • Try not to get overwhelmed by all the content.
  • Don’t memorize. 
  • Take your time to understand the content you are learning.
  • If you fail the first time, try again! Don’t be discouraged.
  • Don’t hurry! In the end, this is all to further your career.

If you want to know more about the information Travis shared with us, we also recommend checking out our Salesforce System Architect: Tips, Role, and Responsibilities article and our webinar about Travis’ full experience. 

Calling Apex methods in Salesforce Lightning web components

Originally published as ¿Cómo Llamar Apex en Lightning Web Component?

 

One of the features that Salesforce gives us is the ability to call Apex methods in Lightning web components. This can be done by importing the method and calling it with the decorator wire service or imperatively.

Calling Apex methods in Salesforce Lightning web components

How to import an Apex method in a Lightning web component?

We can import methods from Apex classes into a component using the import form in ES6 (ECMAScript v6). This way:

  • apexMethodName: Symbol to identify the Apex method.
  • apexMethodReference: Name of the Apex method that we are going to import.
  • Classname: Name of the Apex class in Salesforce.
  • Namespace: If the Apex class is in the same namespace as the component, do not specify a Namespace. If the class is in a managed package, specify the namespace of the managed package.

 

How to expose an Apex method in Lightning web components?

To expose a method of an Apex class in a component, the method must be static and global or public. Also, we need to add the @AuraEnabled annotation to it.

In the following example, we expose a method called getContactList in the component, which returns a list of contacts.

 

 

How to call an Apex method with React Wire?

To read data from Salesforce, the Lightning web component can use the Reactive Wire service. The wire decorator is used to call an Apex method.

In the following example, we call an Apex method using the wire decorator.

 

How to call an Apex method imperatively?

In the next example, we call an Apex method, which returns a list of contacts, imperatively. The imported function returns a promise.

If you are looking for Salesforce technical content in Spanish written by experts, we recommend visiting Snake on Code, where you will find more information regarding Lightning web components, Apex, and more. 

If you enjoyed this article, here are some more that you might enjoy: