Course info
Oct 17, 2017
1h 47m

Formulas are an essential part of every Salesforce admin and developer toolkit, but one that is often learned piecemeal - leaving knowledge gaps that can result in errors and corrupted data. In this course, Formula Fundamentals in Salesforce, you'll learn the fundamentals of formulas from the ground up. First, you'll explore field and data types, operators, and of course, functions. Next, you'll find deep coverage of logical operators - perhaps the most common source of formula bugs. Finally, you'll learn more advanced concepts such as formula limits and formula testing and validation. By the end of this course, you will be able to add formulas to your Salesforce admin and developer toolkit.

About the author
About the author

Dan Appleman is a well known author, software developer, and speaker. Currently the CTO of Full Circle Insights, he is the author of numerous books, ebooks, and online courses on various topics (technology and other). His latest book is "Advanced Apex Programming" - Personal Website

More from the author
Objectivity in Data Visualization
2h 0m
Apr 22, 2019
More courses by Dan Appleman
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Of all the things you need to know to work on the sales force platform, none is more important, or more pervasive, than formulas. They appear everywhere, from fields, to validation rules, to processes, to workflows, to visual force markup. The list goes on. Most people start learning formulas by looking at examples, or searching online for the right formulate to solve a problem, and that's okay, but formulas are such a core technology that it's worth taking the time to learn them properly, to really understand how they work. My name is Dan Appleman, and most people know me from my book and courses on Apex programming, coding, but I'll let you in on a little secret, and don't let it intimidate you. Formulas are code. Simple code, but code nonetheless. For many declarative developers, it's all the code they'll ever need. For others, it is the start of a journey that ends up with them becoming super admins, or even advanced developers. My goal in this course is to help you on that journey, whether you are a sales force admin just starting out with declarative development, or a super admin who is looking for deeper understanding, this course will help you on your journey.

Understanding Data and Operators
Now that you know the mechanics of creating and editing formulas, it's time to dig in and learn about the formulas themselves. You learned in the last module that a formula is a process that takes in data, processes that data using operators and functions, and produces a result. In this module, we're going to first focus on the data. You'll learn how data types and formulas correspond, and don't correspond, to data types on object fields. Next, we'll review some basic math operators, and the idea of operator precedence. Then we'll cover the simple comparison operators, equals, less than, greater than, and how they work with different data types. Finally, we'll cover the logical operators, and, or, and not, and we'll cover them in excruciating depth, because these are by far the greatest source of formula errors. Ready? Let's begin.

Fun with Functions
You've learned about data and data types, and how operators can be used to combine them to produce results. Functions provide yet another way to manipulate data. Functions always take the same form, the name of the function, then 0 or more parameters enclosed in parentheses. Each parameter can be a complete expression with data, operators, and even other formulas. Some functions take a fixed number of parameters, some a variable number of parameters. You can find out about individual functions, what they do, and what parameters they take, by searching for formula operators and functions in the Salesforce help, or by way of your favorite search engine. There you'll find a list of functions divided by category, or click through to see an alphabetical list of functions. Each function includes a description, a list of parameters, a simple usage example, and sometimes additional tips. Here's the documentation for the AND function that you've already seen. As you can see, the number of parameters is variable. In some cases, a parameter might be optional, as shown here for the LPAD function. Optional parameters appear in the documentation in square brackets. Not every function can be used in every formula. You can typically find where a formula can be used in the Tips section, as you can see here with the is new function. In this module, we're not going to cover every available function. Instead, we'll focus on those functions you're going to see most often, with an emphasis on important concepts that are common to different types of functions. Having just completed coverage of logic operators, it seems only logical to start with their function equivalents. Tests and conditions.