Sub topic 8
Opening and understanding a record
This chapter assumes you can already switch apps, open an object tab, and use a list view. If those are unfamiliar, review the earlier chapters on apps, tabs, and list views first. It also assumes you know what an object, a record, and a field are.
A record is one row of data for an object. An Account record is one company, and a Contact record is one person. This chapter covers the ways to open a record, what identifies it, why two users can see different things on the same record, and what to check when a record will not open.
What a record is
Every record has a unique Id. Salesforce generates it when the record is created, and it never changes. The Id is what the URL, search results, related lists, and code all use to point at the record.
An Id has two parts you can read:
- The first three characters are the key prefix, which identifies the object. For example,
001is Account,003is Contact,006is Opportunity,00Qis Lead, and500is Case. - The rest identifies the individual record within the org.
Ids come in two forms. The 15-character form is case-sensitive. The 18-character form adds a three-character suffix so the Id can be compared without regard to case. Both point to the same record. Lightning Experience accepts either one in a URL, but spreadsheets and some integration tools treat uppercase and lowercase as the same letter. If you export Ids to a spreadsheet, use the 18-character form to avoid mismatches.
You can look up a record's key fields with SOQL, for example in the Developer Console Query Editor:
SELECT Id, Name, Industry, RecordType.Name, OwnerId
FROM Account
ORDER BY LastModifiedDate DESC
LIMIT 5The Id column in the results is the value that appears in the record URL. If your org has no record types for Account, RecordType.Name makes the query fail. In that case, remove that field.
Ways to open a record
You can reach the same record from several places. They all end at the same URL pattern, so none of them is more "correct".
| Starting point | What you do |
|---|---|
| List view | Click the link in the Name column, or in any other column that shows a link. |
| Related list | Click the record name in a related list on another record, such as a Contact on an Account. |
| Lookup field | Click the linked value in a lookup field, such as Account Name on a Contact. |
| Global search | Type part of the name and pick the result. |
| Recent items | Pick the record from the object's Recently Viewed list view or the search dropdown. |
| Favorites | Click the star-based shortcut you saved earlier. |
| URL | Paste a record URL into the address bar. |
Hovering over a lookup value or a record name in some places shows a small popover. It lists a few fields defined by the object's compact layout. The compact layout also controls the fields shown at the top of the record page. Use the popover to check who or what a record is without leaving your current page.
A record opened from a link that appears in another record's page usually opens on the same browser tab. Hold Ctrl (Windows) or Cmd (Mac) while clicking to open it in a new browser tab. This works because each record has its own URL.
Reading the record URL
Opening a record changes the address bar to the following pattern:
/lightning/r/Account/001XXXXXXXXXXXXXXX/viewThe parts are:
/lightning/r/means a record page.Accountis the object API name.001XXXXXXXXXXXXXXXis the record Id.viewis the action. The page you are looking at is the view page.
You can copy this URL and share it with someone else in the same org. They will open the same record, as long as they have access to it.
Some objects have a different pattern in a managed app or use a custom object API name, which ends in __c. For example, a custom object named Project would appear as /lightning/r/Project__c/<Id>/view. The pattern is the same.
What shapes what you see
Two people can open the same record and see different pages. Four things decide this, and each is a common source of confusion.
Access to the record
Salesforce checks whether a user can see the record at all. This depends on the object permission (Read on Account, for example) and on sharing. Sharing covers record ownership, the role hierarchy, sharing rules, and manual shares. If the user lacks access, opening the URL shows an insufficient privileges message, even though the Id is valid.
A user with the object's Read permission still may not see a specific record. In a list view, that user simply does not see the row. If a coworker sends you a URL that fails, the problem is usually sharing and not the link.
Access to individual fields
Field-level security hides fields that a profile or permission set cannot read. A hidden field does not appear on the page, and it does not leave an empty gap. Read-only fields show their values but cannot be edited. This is why two users can see different numbers of fields in the Details tab.
The record type
A record type lets one object offer different business processes, picklist values, and layouts. For example, Cases might have a "Billing" type and a "Technical" type. The record type assigned to a record, combined with the user's profile, decides which layout the record uses. If you cannot find a field that a coworker mentions, check the record type first. The coworker may be looking at a record with a different type.
The page layout and Lightning page
A record page has two layers of configuration:
- A page layout controls which fields and related lists appear in the Details and Related areas, and which buttons and actions appear.
- A Lightning record page controls the arrangement of components: where the highlights panel, tabs, and other components sit.
An administrator can assign different layouts and pages by app, record type, and profile. The next chapter looks at the regions of the page in detail. For now, remember that "what does the page look like" has no single answer. It depends on the user, the record, and the app.
Editing and acting on a record
On the view page, you can change data in two ways.
- Use inline editing. Hover over a field value and click the pencil icon. Change the value and click Save. Fields that you cannot edit show no pencil.
- Use the Edit action in the highlights panel. This opens a form with all editable fields from the layout.
Common actions, such as New Contact or Log a Call, come from the actions defined for the page. Most actions create a related record and link it to the current one. You do not need to enter the parent record's name, because the action fills it in.
Validation rules run on save. If a rule fails, the page shows an error message at the top of the form or next to the field. The record is not saved, and no partial change is written.
Edge cases to know
- Deleted records. A deleted record goes to the Recycle Bin. Its URL then shows an error, because the record no longer appears as a normal record. An administrator or the owner can restore it from the Recycle Bin within the retention period.
- Merged records. After a merge, the losing record's Id is gone. Old URLs for it may lead to an error or to the surviving record, depending on the object.
- Records opened in a console app. In a console app, the record opens in a workspace tab, not in the main page area. The Id and the URL are the same. A later chapter covers this.
- Sandbox Ids. A record copied into a sandbox keeps its Id. A record created later in production or in the sandbox gets a different Id. Do not assume Ids match between orgs for records created after the copy.
- Hard-coded Ids. Avoid hard-coding Ids in code or configuration. They are fine for a one-off check but break when the data moves between orgs.
Try it yourself
- Open the Accounts tab and the Recently Viewed list view.
- Click an Account name. Note the Id in the address bar and identify the key prefix.
- Change the end of the URL from
viewtoview?followed by nothing, then reload. Confirm that you reach the same record. - From the Account, click a related Contact. Compare its prefix with the Account's.
- Open the same Account in a second browser tab with Ctrl-click or Cmd-click from a list.
Exercise
A coworker sends you a Lightning record URL for an Opportunity. When you open it, you see an insufficient privileges message. Name two things you would check, and say how the key prefix helps you confirm what the link points to.
Show answer
Check whether your profile or permission set gives you Read access to Opportunities, and whether sharing gives you access to that specific record (owner, role hierarchy, sharing rules, or a manual share). The Id in the URL should start with 006, which is the key prefix for Opportunity. If it starts with another prefix, the link points to a different object than your coworker described.
Exercise
Two users open the same Case. One sees a field called Escalation Reason and the other does not. List three possible causes.
Show answer
Field-level security may hide the field from one user's profile or permission set. The users may be assigned different page layouts through their profiles, or different Lightning record pages through their apps. The record type may map to a layout that includes the field for one profile and not for the other.