From Library to Org: A Step-by-Step Guide to Deploying Solutions

By SF CodeBase
How-To
Guide
Workbench
Deployment
Salesforce
From Library to Org: A Step-by-Step Guide to Deploying Solutions

Introduction

Welcome to SF CodeBase! Our goal is to provide a rich library of micro-solutions to help you build faster and smarter on the Salesforce platform. But finding a solution is only half the battle. How do you get it from our library into your Salesforce org?

This guide will walk you through the entire process, from searching for a solution to deploying it using the popular web-based tool, Workbench.


Step 1: Finding the Right Solution

First, you need to find a solution that fits your needs. Our library is designed to make this easy. On the Solutions page, you can:

  • Search: Use the search bar to look for keywords like "datatable", "lead assignment", or "callout".
  • Filter: Narrow down the results by Type (Flow, Apex, LWC, etc.), Category, Difficulty, or specific Tags.

Filtering helps you quickly zero in on the most relevant components for your specific challenge.


Step 2: Downloading the Solution Package

Once you've found a solution you like, click on it to go to the detail page. Here you'll find a detailed description, setup instructions, and the main action buttons.

  • View & Download: If a solution includes viewable code (like Apex or LWC), this button will take you to a code viewer. You can copy individual snippets or download the complete package from there.
  • Download Solution: For simpler solutions (like a single Flow), this button will directly download the package.

Click the download button. You will receive a .zip file. This file is a standard Salesforce package, containing the component files (e.g., .cls, .flow-meta.xml) and a package.xml manifest file that tells Salesforce what's inside.

Important: Do not unzip this file. Workbench needs the complete .zip package.


Step 3: Preparing for Deployment with Workbench

Now for the deployment. We'll use Workbench, a powerful, free tool for interacting with your Salesforce org.

  1. Navigate to https://workbench.developerforce.com.
  2. For Environment, choose Production or Sandbox depending on where you are deploying. We strongly recommend always deploying to a Sandbox first.
  3. Leave the API version as is and agree to the terms of service.
  4. Click Login with Salesforce. You will be redirected to the standard Salesforce login screen.

Step 4: Deploying the Package

Once you're logged into Workbench, follow these steps carefully:

  1. From the top menu, navigate to Migration -> Deploy.

  2. Under "Upload Zip File", click Choose File and select the .zip package you downloaded from SF CodeBase.

  3. Configure the Deployment Options:

    • Rollback on Error: Check this box. If any part of the deployment fails, Salesforce will automatically undo any changes it made, leaving your org in its original state.
    • Single Package: Ensure this is checked (it's the default).
    • Test Level: This is the most critical setting.
      • RunLocalTests: Recommended for most sandbox deployments. It runs all tests in your org except for those from managed packages.
      • NoTestRun: Only use this for deploying to Sandbox or Dev orgs where you will run tests manually afterward. This is not allowed for production deployments.
      • RunSpecifiedTests: If you know which specific test classes to run to validate this component, list them here.
  4. Click Next. Workbench will show you a confirmation screen with the components it's about to deploy.

  5. Click the Deploy button.

The deployment process will begin. You can monitor its status on the next page. It will show "In Progress," "Succeeded," or "Failed." If it fails, Workbench will provide a link to download the full error logs so you can troubleshoot.

Conclusion

That's it! You've successfully taken a solution from our library and deployed it into your Salesforce org. Always remember to follow the specific setup instructions on the solution's page and, most importantly, test thoroughly in a sandbox before ever deploying to production.

Happy building!

Related Articles

Mastering Salesforce Data Security: A Layered Approach

Understand the core layers of Salesforce data security, from organization-wide defaults to sharing rules and profiles, to build secure and scalable applications.

Mastering Salesforce Data Security: A Layered Approach

Why Salesforce Flows Are Eating the World of Automation

Process Builder and Workflow Rules are on their way out. Discover why Flow is the declarative automation tool of the future and why you should be migrating.

Why Salesforce Flows Are Eating the World of Automation
Read More

Navigating Salesforce's Thrice-Yearly Releases Like a Pro

Salesforce releases new features three times a year. Learn how to stay ahead of the curve and leverage the latest updates for your organization's success.

Navigating Salesforce's Thrice-Yearly Releases Like a Pro