Record inspection
sfd record <id> accepts either a 15-character or an 18-character Salesforce
Id. It uses the case-sensitive three-character prefix to identify the
sObject. If queryable objects share the prefix, it tries them in the order
Salesforce describes them and reports the other candidates in a warning.
The output uses the 18-character Id returned by Salesforce.
| Option | Output |
|---|---|
--all-fields |
Include null fields in text. |
--history <n> |
Show up to this many history rows. The default is 10 and the cap is 200. Zero skips history. |
--no-history |
Skip the history query. Takes precedence over --history. |
--fresh |
Refresh cached global and sObject describes before reading the record. |
--json |
Print the response envelope with all readable fields, including nulls. |
-o <alias> |
Select the target org. |
Fields and lookups
Text shows the record’s name and last modifier, followed by populated fields
in describe order. Each field has a label and API name. Compound addresses
and locations are shown through their component fields. Text values longer
than 200 characters carry their original length. Binary fields show their REST
URL. The byte count is shown only for ContentVersion (ContentSize),
Attachment and Document (BodyLength).
The record is read with one REST GET by Id. Lookup names come from a second query on that record, and the target describes for those lookups come from the describe cache. Field definitions, history rows and author details are read separately, as described below.
Lookup values keep their Id and show the related name or number when Salesforce
returns one. Polymorphic fields such as Owner use the Salesforce Name
relationship. For other lookups the target describe supplies the name field,
such as CaseNumber. If the relationship query fails, the record remains
visible with lookup Ids and a warning. The Tooling API supplies the count of
custom fields absent from the record describe. If that check fails, the count
is unavailable and the output includes a warning.
Field history
History reads the object’s Histories relationship and checks whether tracking
is enabled in Tooling field definitions. Rows are ordered by date and then Id,
newest first. A separate User query supplies author types and profiles.
| Status | Meaning |
|---|---|
ok |
At least one history row was returned. |
empty |
The history query returned zero rows. If the Tooling field-definition check fails, a warning reports that field access or history tracking could not be checked; the status is unchanged. |
not-tracked |
The object has no history relationship, tracking is off, or Tooling reports object tracking with zero tracked fields. |
skipped |
The requested history limit was zero, or the history query was unavailable. In the latter case the JSON includes reason: "unavailable" and the output has a warning. |
The modified.by object includes the name, UserType, profile and classified
kind. AutomatedProcess, CloudIntegrationUser and profiles with
“integration” in their name classify as automation. Other Standard users
classify as person. Remaining cases, including unavailable user details,
classify as unknown.
The kind describes the user who saved the record. Record-triggered flows,
including async paths, can change fields under the triggering user’s identity.
If several history rows share the latest second, the output gives their
count and suggests sfd impact <Object> to inspect object automation.
Schedule-triggered flows use Automated Process below Flow API 53.0 or when no Default Workflow User is configured. Other flows generally use the current user. A flow triggered by a standard platform event can use Automated Process when that user publishes the event. Apex debug logs for platform event flows show Automated Process regardless of the running user. Salesforce Admins guide to the Flow running user
JSON result
The normal --json envelope contains a result with sobject, id, name,
modified and created audit details, fields, hidden, history and
warnings. Each field contains name, label, type and the original
value, plus ref with the related sobject and name when resolved.
hidden.null counts null fields and hidden.noAccess is the custom-field
count, or null when the Tooling check fails. history contains the status,
requested limit after capping, history object when available, tracked field
names, rows and sameSecondChanges. Values in JSON retain their full length.