Metadata Metadata Types Guide | SalesforceTutorial

Written by Prasanth Kumar Published on Updated on

Metadata metadata is the Salesforce configuration layer that defines objects, fields, automation, security, code, layouts, and deployable settings. Records are data; the structure and behavior around those records are metadata. This metadata guide explains sfdc metadata types, deployment, metadata report usage, and safeguards for production orgs.

metadata metadata architecture for Salesforce metadata and deployment planning

What is Metadata Metadata in Salesforce?

Metadata metadata means the definitions that tell a Salesforce org how to work. A custom object defines which records can exist. A custom field defines which values can be stored. Validation rules stop invalid saves. Flows, Apex, approval processes, layouts, Lightning pages, permission sets, and profiles define behavior, automation, interface, and access. Salesforce documents Metadata API as the API used to retrieve and deploy metadata between orgs during development: Metadata API Developer Guide.

How is platform metadata different from data?

Data is an Account, Case, Contact, Lead, Opportunity, or custom object record. Metadata is the object, field, page layout, validation rule, Flow, permission, report, dashboard, and code definition that controls that record. Metadata changes can affect many users at once, so treat configuration changes like application releases.

Salesforce record metadata example showing object and field configuration
Item Data Metadata
Sales process Opportunity Amount Stage picklist, path, validation rule
Service process Case comment Queue, assignment rule, Flow
Security Account row Permission set, profile, sharing rule, FLS

What are the main sfdc metadata types?

Metadata type names are named component categories used by Metadata API and Salesforce CLI. Salesforce states that metadata type names are case-sensitive in the Metadata Types reference. Common types include CustomObject, CustomField, Layout, RecordType, ValidationRule, Flow, ApexClass, ApexTrigger, PermissionSet, Profile, LightningComponentBundle, CustomApplication, Report, Dashboard, GlobalValueSet, and CustomMetadata.

Sfdc metadata types for admins

Admins usually edit metadata components in Setup. A field added with Object Manager, a screen Flow, a record-triggered Flow, a permission set, and a Lightning page are all deployable configuration when supported by the chosen channel.

Salesforce metadata types for developers

Developers store salesforce metadata in a Salesforce DX project and version control. Validate deployability against the official Metadata Coverage Report, because support can differ for Metadata API, source tracking, unlocked packaging, managed packaging, and change sets.

Custom metadata types in Salesforce

This configuration layer includes custom metadata types. Salesforce Trailhead describes them as customizable, deployable, packageable, and upgradeable application metadata: Custom Metadata Types Basics. Use custom metadata for rules, mappings, and feature switches that must move with a release. Do not store secrets in custom metadata.

How should you use a metadata report?

A metadata inventory can mean the official Salesforce coverage report or an inventory report for your org. For coverage, use the Metadata Coverage Report. For an org inventory, retrieve metadata into source control and report from the XML files. A useful metadata inventory records component name, metadata type, owner, package, source API version, target org, test evidence, and rollback step.

<Package xmlns='http://soap.sforce.com/2006/04/metadata'><types><members>Invoice__c</members><name>CustomObject</name></types><types><members>Invoice_Approval</members><name>Flow</name></types><types><members>Tax_Rule.Standard_GST</members><name>CustomMetadata</name></types><version>67.0</version></Package>
sf org login web --alias DevSandbox
sf project retrieve start --manifest manifest/package.xml --target-org DevSandbox

How does metadata metadata affect validation rules?

Validation rules are metadata. They run before a record saves and can block UI edits, imports, integrations, screen flows, and Apex DML. Test validation rule changes with real user personas and integration users before production deployment.

validation rule metadata setup for custom fields
metadata metadata validation formula for invoice reference format
AND(NOT(ISBLANK(Invoice_Number__c)), NOT(REGEX(Invoice_Number__c, "INV-[0-9]{6}")))

How does platform metadata drive automation?

Platform metadata drives automation through Flow, approval processes, assignment rules, escalation rules, and Apex. A Flow that works for one record can fail during a bulk load if it performs too many queries, updates too many related records, or calls non-bulkified Apex.

Salesforce flow metadata automation using field values

How do developers read custom metadata in Apex?

Custom metadata records are useful when Apex needs deployable configuration. Salesforce documents custom metadata type methods here: Apex custom metadata methods. The example assumes Tax_Rule__mdt has Is_Active__c and Rate__c.

public with sharing class TaxRuleService { @AuraEnabled(cacheable=true) public static Map<String, Decimal> getActiveRates() { Map<String, Decimal> rates = new Map<String, Decimal>(); for (Tax_Rule__mdt ruleRecord : Tax_Rule__mdt.getAll().values()) { if (ruleRecord.Is_Active__c == true) { rates.put(ruleRecord.DeveloperName, ruleRecord.Rate__c); } } return rates; } }

Governor limit note: load custom metadata once per transaction path instead of reading it repeatedly inside loops. For ordinary sObject data, enforce object and field permissions as Salesforce documents for Apex security: Secure Apex Classes.

How do you check where metadata is used?

Before changing field metadata in a metadata release, use Where is this used? where available. Salesforce Help explains that it can show custom field references, including formula and Apex references: Find Where a Field Is Used. Also search source control and run validation deployments.

custom field metadata where is this used custom field reference check
sfdc metadata types dependency view before deployment

Best practices for protecting metadata metadata

Protecting metadata metadata means controlling how configuration enters production and how the team recovers after a failed release. Keep metadata in source control, review pull requests, check the coverage report, validate destructive changes, test user personas, and create a baseline export or repository tag before production deployment.

metadata metadata backup and source control workflow for Salesforce

For related SalesforceTutorial references, review Salesforce Metadata API examples, custom metadata types in Salesforce, Salesforce change sets for admins, Salesforce Flow automation examples, and Apex governor limits in Salesforce.

Frequently Asked Questions

What does metadata metadata mean in Salesforce?

Metadata metadata is the configuration layer that defines how Salesforce data is stored, shown, automated, secured, and deployed.

What are the main sfdc metadata types?

Common sfdc metadata types include CustomObject, CustomField, Layout, Flow, ValidationRule, ApexClass, PermissionSet, Profile, LightningComponentBundle, Report, and CustomMetadata.

Can I create a metadata report for an org?

Yes. Use the official Metadata Coverage Report for platform support, and retrieve org metadata into source control when you need an org-specific metadata report.