Admins / Developers

What Is Salesforce Metadata? A Complete Overview

By Shyam Oza

Salesforce metadata is the configurations, code, automation logic, and page layouts that define how objects (and therefore records) behave – and also the “look and feel” of your Salesforce org.

You may have heard metadata described as “data about data” – but what does that even mean in a Salesforce context? Let’s dig into the what, why, and the how of Salesforce metadata.

What is Salesforce Metadata?

Salesforce metadata are parts of Salesforce that define how objects behave and how your org looks – metadata are the “nuts and bolts” of your Salesforce org. Like a house, your Salesforce org is held together in a particular way, tailored to your business.

Salesforce Metadata vs Data

You may assume that metadata and data are the same – they are not.

  • Data relates to the records that a business relies on, e.g. users, accounts, contacts, etc.
  • Metadata is the data that describes data, the way that records behave and the “look and feel” of your Salesforce org.

Salesforce Metadata Types

Types of metadata in Salesforce include:

  • Data: The core components of the data structure on which most customization is built, e.g. custom objects, picklist value sets, and custom apps.
  • Programmability: Custom code developed on top of the platform, e.g. Flows, Apex classes, and Apex Triggers.
  • Presentation: Customization for how users interact with the platform, e.g. components, VisualForce and Lightning pages.
  • Custom metadata types: Go beyond the types that Salesforce provides out of the box. Supports complex data types for custom fields creation and storing information, e.g. mappings, business rules, and secrets.

A full list of Salesforce metadata types can be found here.

READ MORE: Introduction to Custom Metadata Types

Working With Salesforce Metadata

Metadata can be:

  • Imported into Salesforce.
  • Modified via Salesforce Setup using declarative (point-and-click), or programmatic (pro-code), configuration.
  • Manipulated via the Salesforce Metadata API – retrieve related assets and deploy assets to Salesforce orgs.

Some organizations with mammoth orgs have ‘staggering’ amounts of metadata, e.g. 200,000 reports and email templates, 50,000 Apex classes, and 1,300 permission sets.

READ MORE: 1 Billion Salesforce Metadata Items: 10 Things We Learned

Why Salesforce Metadata?

Hard-coded applications are a thing of the past – configuration is the flair of the season.

Organizations need flexible applications that can be tailored to what their business requires, without needing high-level programming skills. Metadata is what transforms Salesforce from a simple database into an entire platform – that’s why Salesforce metadata is so powerful.

Example 1: Salesforce Record Metadata

First, let’s look at metadata in its most basic form.

For this example, our bicycle manufacturing company has just closed a deal with Austin Bicycle Enterprise. The Salesforce opportunity record is our data. A field e.g. “Lead Source” is metadata that describes the opportunity, providing valuable insight. Even the Account Name field is essential metadata; without that information we wouldn’t know what to name this opportunity!

Report on metadata, e.g. at the end of the year, compare the success of opportunities from trade shows vs other sources.

READ MORE: Let’s Talk About Salesforce Lead Source

Example 2: Validation Rules

Sales reps, support agents and other users enrich Salesforce with data as they do their jobs. One big challenge is Salesforce data quality. A great way to solve this is with validation rules, which are checks you can add to your Salesforce object metadata.

READ MORE: How to Use Validation Rules in Salesforce (+ Examples)

In the example below, I’m creating a rule to ensure our ContractIDs follow the approved corporate format. I can also create more complex rules with formulas like vLookups (Excel fans rejoice!) to solve simple problems like ensuring the correct zip code is being entered.

Example 3: Automation

Unitrends, the example partner subsidiary company, faces challenges when it comes to fulfillment and provisioning. Depending on their needs, customers purchase hardware, software, or SaaS subscriptions – sometimes they buy all three!

These simple Metadata values have a big impact on our internal processes. Using Salesforce Flow, each of these values kicks off different requests and different teams move into action depending on the value. If a customer simply needs Office 365 SaaS backup, everything is fully automated: charging, billing, etc. are all handled by the software.

Protecting Salesforce Metadata

The power of Salesforce lies in the ability to customize an org. What this boils down to, is this: adding and modifying metadata.

While this is easy to do, if you get it wrong there could be serious consequences…

READ MORE: 10 Things We Learnt from Analyzing 1 Billion Salesforce Metadata Items

“Where Is This Used?” Feature

“Where is this used?” makes it possible for administrators to check references to a custom field, e.g. where it’s used in a page layout or Apex trigger.

READ MORE: Where is This Field Used? The New Whereused Button in Salesforce

You can see where a field is used and where changes to the field appear before you edit it.

Salesforce Metadata Backup

We’ve compared how metadata data work to a house and its foundations. The house itself may have certain protections in place (an alarm, fence, locked windows, etc.) In a Salesforce context, this is user permissions, login credentials, and login ranges:

But what about protecting the foundations? It’s critical to back up your information in the event of a data incident. Remember that most data loss isn’t the result of freak accidents – instead, it’s often caused by human error. Examples include accidentally deleting essential security settings or a developer releasing a bad code – this can happen to anyone but could be extremely detrimental to your Salesforce org.

When disasters occur below ground level, who do you call?

READ MORE: Demystifying Metadata Backup

Packaging Salesforce Metadata

Most Salesforce orgs contain a sea of unpackaged metadata. Some customizations are made by hand with the Setup Menu, others are created with change sets or the metadata API.

Unpackaged customizations can pile up over time and make the org difficult to manage. Too many customizations can result in slow performance, reduced agility, sluggish adoption, and added complexity. That’s where packaging comes in to save the day.

READ MORE: Breaking Your Org into Packages with Salesforce DX and the Metadata API

Summary

Organizations need flexible applications that can be tailored as per your business required, without needing high-level programming skills. Metadata is what transforms Salesforce from a simple database into an entire platform – that’s why Salesforce metadata is so powerful.

  • Types of metadata include: Data, programmability (e.g. Flows, Apex classes, and Apex Triggers), presentation (e.g. components, VisualForce and Lightning pages), and custom metadata types.
  • The “Where Is This Used?” button: Use this to check references to a custom field, e.g. where it’s used in a page layout or Apex trigger before making any changes.
  • Metadata backup: In reality, Salesforce Metadata and Data loss occurs more often than administrators would like to admit. Although Salesforce has a great security infrastructure, it does not provide coverage against data loss at your end, including human error, sync error, ransomware, and insider threats – so, backup your Salesforce metadata!

The Author

Shyam Oza

Senior Product Marketing Manager at AvePoint specializing in SaaS Data Resilience. NJIT Alumni. Gaming and gadget freak.

Leave a Reply