RP.
Back to Blogs / Understanding sObjects
Data Architecture Jan 19, 2026

sObjects: The Digital Containers

In Salesforce, an sObject is a database table that stores your data. Whether it is a Standard object provided by Salesforce or a Custom object you built, they all follow the same underlying architecture.

Standard Objects

Pre-built objects like Account, Contact and Lead. These come out-of-the-box with standard business logic.

Example: Account

Custom Objects

Objects you create to store information unique to your business. Identified by the __c suffix in the API name.

Example: Project__c

Generic sObject

In Apex, you can use the generic sObject type to represent any record, providing massive flexibility in your code.

sObject myRec = new Account();

Metadata vs Data

The Architecture

Metadata (The Schema)

This is the structure of your object—the fields, the data types, and the relationships.

Data (The Record)

This is the actual information stored within that structure (e.g., "Grand Hotels" as an Account Name).

SYSTEM_ID_0921X
API Name Position__c
Record ID a012x00000Xyz

Apex Fundamentals

The sObject Keyword

Any object that can be stored on the Lightning Platform is termed as a Salesforce Object or sObject. In Apex, this acts as the base class for all standard and custom records.

Instantiation & Access

You can use the sObject keyword to create an instance of any object. Use the new keyword for instantiation and the dot operator to access fields.

Apex // Generic Instantiation

sObject genericRec = new Account();

genericRec.put('Name', 'Data Fortress Inc');


// Concrete Access via Dot Operator

Account myAcc = new Account();

myAcc.Name = 'Ram Prasad';

Type Casting

Generic sObjects can be cast back into their specific concrete types to regain full field access.

// Casting generic to concrete
Account a = (Account)genericRec;
!

Important Note

Custom Labels cannot be instantiated and are not standard sObjects.

They are accessed directly via the System class (e.g., System.Label.LabelName).