Skip to content

Standard fields

Every object carries a set of standard fields the kernel mints on the physical table and maintains on every write. They are the analogue of Salesforce’s standard fields — the Id, OwnerId, CreatedDate, LastModifiedById, SystemModstamp, IsDeleted set present on every SObject. An object author declares only the business fields on top of this set.

Source: SYSTEM_COLUMNS in the physical DDL planner.

Standard field Backing column Salesforce analogue Meaning
Record id id Id UUID primary key, globally unique within the tenant
Tenant org_id (org boundary) The org a row belongs to — multi-tenant scope
Parent parent_id (master-detail parent) The composition edge for detail records
Owner owner_id OwnerId The principal who owns the row; drives the record-access predicate
Created by created_by_id CreatedById The principal who created the row
Created date created_at CreatedDate When the row was created
Last modified by last_modified_by_id LastModifiedById The principal who last changed the row
Last modified date updated_at LastModifiedDate / SystemModstamp When the row was last changed
Change version row_version ≈ SystemModstamp counter Monotonic optimistic-lock stamp, bumped on every write
Soft-delete marker deleted_at IsDeleted Tombstone timestamp; the row survives for restore and audit

The save order stamps these from the request’s authenticated principal — created_by_id at insert, last_modified_by_id and updated_at on every write — so attribution is a queryable column on the record, not a value reconstructed from a log. Because the kernel owns them, they are uniform across custom objects, standard objects, and any object a package introduces, and a business field cannot shadow one.

The full change history lives in an always-on audit stream, the analogue of Salesforce Field History:

  • data_history — one row per changed field, carrying the actor, object, record_id, field_key, old_value → new_value, change_kind, a correlation_id tying the change to the request that made it, and the bypass_key if a named bypass was engaged. Every field is captured, and the correlation id ties each change back to its originating request.
  • A second metadata-audit stream covers metadata (deploy) changes on the same envelope, the analogue of the Setup Audit Trail.

The standard columns answer “who owns / created / last changed this record, and when”; the audit stream answers “what exactly changed, field by field, in which request.”

Two standard fields track a record’s recency for the running user:

  • LastViewedDate — when the current user last directly viewed this record (opened its detail), as distinct from merely seeing it in a list.
  • LastReferencedDate — when the current user last viewed this record or something that references it: a related record, a list view, or a search result that surfaces it.

LastReferencedDate is a superset of LastViewedDate — a directly viewed record is by definition also referenced, so a direct open advances both, while a reference alone advances only LastReferencedDate. A record therefore carries a LastReferencedDate with a null LastViewedDate when it has been referenced but never opened. Both are per-user (two users see their own values), resolved for the requesting user at query time, and stamped asynchronously off the read’s critical path. They are recency signals, not audit fields.

A per-user recency store keyed by (principal_id, org_id, object, record_id) holds last_viewed_at and last_referenced_at. A direct read stamps both; a reference — a lookup, a list view, or a search result — stamps last_referenced_at only. Reads route through record access, so the recency of a record the user cannot see is never surfaced, and a record that leaves the user’s access simply falls out of their Recently Viewed list, which these rows drive.

Salesforce field CAOS field Semantics
Id id UUID identity
OwnerId owner_id Owning principal; drives record access
CreatedById / CreatedDate created_by_id / created_at Creator + creation time
LastModifiedById / LastModifiedDate last_modified_by_id / updated_at Last editor + edit time
SystemModstamp row_version / updated_at Change stamp; row_version is the optimistic-lock counter
IsDeleted deleted_at Tombstone timestamp — carries when, feeding restore and retention
LastViewedDate LastViewedDate Per-user, async — the current user’s last direct view
LastReferencedDate LastReferencedDate Per-user, async — the current user’s last view of this or a referencing record
  • Audit covers every field. Salesforce field history is opt-in per field and capped; the data_history stream captures every field change, with a correlation id back to the originating request.
  • Soft-delete carries a timestamp, not a flag. deleted_at records when, feeding restore, the recycle bin, and retention without a second bookkeeping field.
  • Optimistic concurrency is standard. row_version gives every object a first-class optimistic-lock stamp rather than leaving concurrency to modstamp comparison.