Abekus — AI learning and job matching platform logo

Metadata vs data records

Lesson 3 of 82 in Salesforce Interview Mastery. Free to read, no account needed.

Metadata and data records

Every Salesforce org holds two kinds of things. Metadata describes how the org is built: its objects, fields and settings. Data records are the business information itself: the actual customers, orders and amounts. Metadata is the blueprint and records are what gets filled in. Learning to tell them apart is the first step to reading any org.

Metadata: definitions and configuration

Metadata is the definition or configuration that describes an org's structure. At Sahyadri Traders, the org's metadata includes:

  • The Order__c object definition, which says that orders exist and what they are
  • The Status__c picklist, with its values Draft, Confirmed, Dispatched and Delivered
  • The Total_Amount__c field, a currency field set to INR
  • The Distributor record type on the Account object

None of these hold a specific customer or order. They describe what any order is allowed to look like.

Data records: business data

A data record is one instance of an object, holding real business data. Each row is one specific thing. The Diwali bulk order, stored as one Order__c record, holds these values:

FieldValue on this record
Status__cConfirmed
Total_Amount__cINR 4,80,000

The Account named Sahyadri Traders is also a data record, because it is one real distributor's row.

Definitions shape the records

Metadata defines the shape of the data, and every data record must conform to that shape. The Order__c definition says each order has a Status__c picklist with four allowed values, and a Total_Amount__c currency field. So each Order__c record must pick one of the four statuses and hold a currency amount.

Suppose someone tries to save an order with Status__c set to Shipped. The save fails, because Shipped is not in the picklist definition. Dispatched would be accepted.

Classifying org items

To classify an item, ask whether it describes structure or holds a specific business fact. Here is a mixed list from Sahyadri Traders:

Org itemKindReason
Account 'Sahyadri Traders'Data recordOne real distributor's row
Dispatched value in Status__cMetadataAn allowed choice in the definition
Diwali order with INR 4,80,000Data recordOne specific order's amount
Total_Amount__c set to INRMetadataDefines the field's currency

Lessons in How the Salesforce Platform Fits Together

  1. What an org is
  2. Standard vs custom objects
  3. Metadata vs data records
  4. Sandbox types and their refresh trade-offs
  5. Record-triggered flow vs apex trigger
  6. Formula field vs roll-up summary field
  7. Lookup vs master-detail relationship
  8. Sf cli project and metadata deploy
  9. Scratch orgs from a definition file
  10. Unlocked vs managed packages

82 lessons across 10 topics. See the full course