The Hard Coded IDs Report in Metazoa Snapshot finds Salesforce record IDs typed directly into metadata and shows what each ID references. Use the report to find references already broken in the connected org and IDs that may break when metadata moves between orgs.
When To Use This Report
- Before deploying metadata between production and a sandbox.
- After a sandbox refresh when automation stops working.
- During recurring technical debt or code reviews.
- When investigating references to deleted records, users, queues, or record types.
Unlike dependency reports, this report focuses on literal Salesforce IDs embedded in metadata, rather than named metadata references.
Open The Report
- Right-click a Metadata Snapshot item on the Snapshot desktop.
- Select Optimize, then Hard Coded IDs.
The report logs into the org using the snapshot credentials to support ID lookups. A failed login prevents the report from opening. Use a Regular Snapshot; Developer Projects are not supported.
Select Metadata
As the admin, check each metadata type to include in the scan. Use Quick Find Metadata Types to narrow the list; types absent from the snapshot are grayed out. Right-click the list for Check All Types, Check Base Types, or Check None.
Selecting a type immediately previews that type; checking types determines the final report. Child types, such as fields and validation rules, scan individual elements so the finding identifies the element containing the ID.
Display Report
Open Display Report to scan the checked types. The Reports view contains one table per metadata type and one row per distinct ID found in an asset.
Enable Lookup Org Records to query IDs not matched in the snapshot. Disabling this option produces a faster scan based on snapshot matches and key prefixes, without confirming remaining targets in the org.
Use Show Usage for surrounding text, Show Create Modify for asset authors and dates, and Show Links for links that launch the Salesforce Browser. Clean Report hides empty tables. Sort by asset, ID, prefix object, resolution, occurrences, or creation and modification details.
| Column | Description |
|---|---|
| Asset Name | Asset containing the ID; the parent asset for child types. |
| Element Name | Child element containing the ID, when applicable. |
| Hard Coded ID | The 15- or 18-character ID exactly as written. |
| Prefix Object | Object type identified by the ID's first three characters. |
| Refers To | Matched metadata asset, org record, or prefix-based description. |
| Resolution | How the target was identified; labels are explained below. |
| Occurrences | Number of appearances of the ID within the asset. |
| Usage Snippet | Text around the first occurrence. |
| Broken Flag | True for a reference classified as broken. |
Dashboards And Summary
Click Dashboards to reveal Metadata Types By Hard Coded IDs, which compares broken and resolved IDs, and Metadata Types By Assets With Hard Coded IDs, which compares affected assets.
Click Summary to reveal one row per scanned metadata type and a Totals row, including Resolved IDs and Broken IDs.
| Column | Description |
|---|---|
| Total Assets | Assets scanned, including assets without findings. |
| Assets With IDs | Assets containing at least one hard coded ID. |
| Hard Coded IDs | Distinct ID findings across the scanned assets, rather than total occurrences. |
| Assets With IDs % | Percentage of scanned assets containing hard coded IDs. |
Schedule Report
Use Schedule Report to run the scan on a timer and send results to Email, Slack, Content, or Chatter. The Assistant destination records results as Org Intelligence, stores the chosen document format, and replaces the previous recording on each run. The condition If Hard Coded IDs Reported sends output only when the scan finds hard coded IDs.
What The Results Tell You
The report first matches IDs against metadata assets in the snapshot, including custom fields and record types, then uses the connected org when lookups are enabled.
- Snapshot Asset: The ID matches a metadata asset in the snapshot.
- Org Record: A lookup found the record; Refers To shows the record name.
- Org Metadata: A Tooling API lookup found metadata outside the snapshot.
- Prefix Only: The object type is known, but lookup was disabled or failed. Existence remains unconfirmed.
- Missing In Org: A completed lookup found no matching record or metadata target.
- Unknown Prefix: No snapshot match or recognized object key prefix was found.
With Color Code enabled, red marks broken references labeled Missing In Org or Unknown Prefix; yellow marks resolved references. Review Resolution rather than relying on color alone, especially for Prefix Only.
Start with broken references, then use Occurrences and Usage Snippet to locate repeated literals. A resolved ID does not prove cross-org portability, and this scan does not execute automation or establish regression-test coverage.
Try The Report
- In a sandbox, create a disposable Account and have a developer place that Account's ID as a literal in
Example_Class. - Capture the class in a Regular Snapshot. Open the report, check Apex Classes, and enable Lookup Org Records.
- Schedule the report and keep an export of the first run. Expect Org Record for the Account ID.
- Delete only the disposable Account in Salesforce, leaving the class unchanged.
- Compare the next scheduled output with the saved export. Expect Missing In Org, showing that a target can disappear even when the metadata stays unchanged. Assign the finding to the developer for replacement.
Export And Explain Results
Right-click a table and select Export As CSV, Export As XLSX for native Excel, Export As PDF, or Export As HTML.
Select Explain Report Table to ask the Intelligent Assistant to summarize findings and recommend replacements. The explanation supports review; this report does not apply fixes or deploy metadata.
Reference
ID Detection Rules
- IDs contain 15 or 18 letters and digits, including at least three digits and one letter.
- An 18-character ID must have a valid Salesforce checksum in the final three characters.
- A 15-character ID must match a snapshot asset or known key prefix.
- The containing asset's own ID and empty IDs such as
000000000000000AAAare skipped. - Managed package assets and metadata buddy files ending in
-meta.xmlare skipped. - The 15- and 18-character versions of the same ID are combined into one finding.
Replacement Patterns
- Record Types: look up by Developer Name.
- Users, Queues, and Groups: store a Developer Name or Username in Custom Metadata and query the ID at run time.
- Profiles and Permission Sets: query by Name.
- Reports, Dashboards, and Documents: reference a Developer Name or store the value in a Custom Label.
- Environment-specific values: use Custom Metadata or Custom Labels with values appropriate to each org.
Cancel A Long Scan
Hold Escape to cancel a scan. Release Escape when prompted to continue.
Common Questions
Why Does A Salesforce ID Show Prefix Only?
The object prefix is recognized, but org lookup was disabled or failed. Enable Lookup Org Records and run the scan again; a failed lookup is not proof of a missing record.
Can I Scan A Developer Project?
No. The report requires a Regular Snapshot and an org login.
Does A Resolved ID Mean Deployment Is Safe?
No. Resolution describes the snapshot or connected org, not the destination org. Release managers still need deployment validation and testing of affected business processes.
Related Articles
- View Assets, Profiles, and Permission Sets - Inspect the containing metadata.
- Impact Analysis Report - Explore named metadata dependencies.
- Append Snapshot - Refresh selected captured assets.
- Deploy Metadata - Validate and deploy corrected metadata.
Further Reading
- Removing Technical Debt - Plan recurring cleanup reviews.
- Clone Orgs with Shell Assets - Understand staged metadata cloning.
- Salesforce Org Splits (also covers Org Clones) - Plan cross-org migration and testing.