Code Builder for Salesforce Admins.

Code Builder for Salesforce Admins

By

I bet you can’t recall the last time you thought, “Oh, I know Code Builder can help me do that.” Think hard, because I bet the answer is never. Now contrast that with previous tools like the Developer Console and Workbench, and the answer is “I’m glad I had that.” I think we haven’t given Code Builder a chance. In fact, I dare say that after this post the five words that come to mind for many solutions will be “Code Builder can do that.”

What exactly is Code Builder?

It’s a very different concept than the Developer Console and Workbench. While both are web-based tools that run on a conventional client-server architecture, Code Builder uses the latest web technologies to provide a virtual instance of running Visual Studio Code, or VS Code, within your browser. This means what you see on your web page is not a simple response to a server, but rather direct access to an instance of software running on Amazon Web Services (AWS). It’s all the power of VS Code without having to install VS Code on your computer. This has some specific ramifications as to how it can be used within your org.

What is VS Code?

VS Code is Microsoft’s free and open source integrated development environment (IDE). While any tool is capable of utilizing the Salesforce Platform to build applications, Salesforce has focused on VS Code to develop tools to build on the platform. This comes in the form of various plugins designed for VS Code, which makes it easy to authenticate to an org and deploy code. But it can also do much more, and it’s that “much more” that’s helpful to admins.

Install Code Builder in your org

Code Builder is offered as an AppExchange package that you can install in your org depending on your edition. For availability, installation steps, and additional licenses, see the Code Builder installation documentation.

Connect Code Builder to your org

It might seem a little counterintuitive, but remember that Code Builder is a piece of software running on an Amazon instance being visualized on a web page. It can’t directly access the information on your org without your permission. Likewise, that Amazon instance is secured to whomever logs into the instance — meaning that once connected, anything you utilize in Code Builder is only visible to someone with the right credentials.

Connecting is simple.

  1. After launching Code Builder, you should see a page with a button to connect the org. If not, go to and click the search bar at the top, and select Show and Run Commands. Then, type Auth to filter down the commands, and select SFDX: Authorize an Org.
  2. Select the proper URL for your org.
  3. Enter an alias for your org. This gives it a human-friendly moniker to refer to later.
  4. You’ll be directed to a page that submits a random code. Log in with your Salesforce credentials.
  5. Grant the Salesforce CLI the permissions.
  6. You’ll get a confirmation that you’re connected and you can return to Code Builder.

You’re ready to go. If connected correctly, you should see the alias from step 3 in the lower left corner. If you don’t, try refreshing the page.

While Code Builder has a lot of possibilities, we’ll focus on two ways it can help your job.

  • Create Salesforce Object Query Language (SOQL) queries to search and review data in your org.
  • Get one place to look at various aspects of your org, like custom objects and fields.

Access your data easily with SOQL Builder

Out of the gate, Code Builder will understand your metadata. SOQL allows you to search against your data while applying filters to get the answers you want.

If you’re unfamiliar with SOQL, let’s break down a simple query.

SOQL Query broken down into 3 parts: 1) SELECT ID, Name from Account 2) WHERE CreatedDate = Today 3) ORDER BY Name ASC.

  1. The first line sets up the object to search from (Account) and the fields you want returned (ID, Name).
  2. The second line defines how to filter down to the records you want; in this case, accounts created today.
  3. Finally, how do you want the data arranged? In this case, order ascending by name.

SOQL Builder is built into Code Builder and allows you to easily generate queries to view your data. To access it, go back to the search bar at the top, select Show and Run Commands, type SOQL, and select SFDX: Create Query in SOQL Builder. You’ll see an interface like this:

SOQL Builder UI Breaking down the parts of the creating a query.

Here, you can:

  1. Select the object to query against.
  2. Pick which fields you want to return.
  3. In a manner very similar to building out formulas, create filters to narrow down the results.
  4. Determine a field to order the results by, and in which direction. 
  5. Specify a limit to the number of results returned. The default and max is 2,000.

You’ll see the generated query on the right. When ready, click Run Query. You’ll see a table of results like so:

Output from the SOQL query showing FirstNam,e LastName.

To access Org Browser, click the dark cloud icon on the left navbar. To get the latest, update the browser by clicking the refresh circle at the top. Now you have a list of all the top-tier metadata objects in your org.

Want to get a snapshot of everything about the current version of your Account object? Go to Custom Objects, and then click the cloud icon with the down arrow next to Account. This will download the current metadata to this instance of Code Builder.  

Once downloaded, go to the Explorer icon at the top of the left nav bar and click the force-app/main/default folder to see anything downloaded from Org Browser. If you click open the objects/Account folder, you’ll see your snapshot of everything from fields to list views, as such:

Screenshot of Org Browser drilled down to the listviews for Account.

But wait, there’s more

This only scratches the surface of how Code Builder can interact with your org and help you perform various tasks. Everything you’ve seen here is just viewing data and structure, but Code Builder can give you methods to update the data and structure as well. Be sure to regularly check admin.salesforce.com for more in the future. Until then, check out the following resources.

Resources

Make Your Sales and Service Reps' Lives Easier with AI.

5 Ways to Make Your Sales and Service Reps’ Lives Easier with AI

Salesforce is ever-expanding its product offerings, and this year, the most fantastic features of the platform are all things artificial intelligence (AI). Have you started exploring capabilities? Are you truly getting the most from the features? In this post, we’ll cover five ways to make your sales and service reps’ lives easier with AI. 1. […]

READ MORE
Product Announcements You Might Have Missed in 2023.

Product Announcements You Might Have Missed in 2023

In the Spring ’23, Summer ’23, and Winter ’24 Salesforce Releases, Salesforce launched hundreds of new features. Make sure you’re up to date on the latest and greatest features for admins by reading about the new features admins were most excited about this year.  Lightning Experience enhancements From new Dynamic Forms enhancements to the Prompt […]

READ MORE
Drive productivity with Dynamic Forms.

3 Ways to Drive Productivity with Dynamic Forms

Salesforce is a great tool for building out custom solutions to meet your organization’s unique needs. You have tremendous flexibility in building out a data model and user interface (UI) that captures all of the complexity of your specific user workflows using our low-code tools. This flexibility can sometimes come at a cost, however. Over […]

READ MORE