Not verified hands-on. This article was written from primary documentation rather than reproduced in an org, so it carries no tested-release badge. If you run it and something differs, say so in the comments and it gets tested and corrected.

The short answer: a compact layout holds up to ten fields, is assigned per record type, and drives the highlights panel on desktop, the record header in the mobile app, and the preview cards that appear in several other places. The highlights panel shows fewer fields than the compact layout can hold, and it fills from the top. So when the wrong fields appear, the cause is almost always the record type assignment or the field order, and almost never the layout itself being broken.

Where a compact layout actually shows up

  • The highlights panel at the top of a Lightning record page.
  • The record header in the Salesforce mobile app.
  • Preview and hover cards where the platform shows a summary of a related record.
  • Notification detail and several list and search contexts that render a record summary.

What it does not drive is the record body. Those fields come from the page layout, or from Dynamic Forms if the page has been upgraded. Changing a compact layout and expecting a field to appear in the detail section is a common first mistake.

The limits worth memorising

Ten fields is the cap, and not every type is eligible: long text areas, rich text and multi-select picklists are out, along with others that would not render on a single line.

The record’s name appears in the header regardless of what the compact layout says, so do not spend one of your ten slots on it. Standard fields such as the record’s status often earn a slot. Audit fields almost never do.

Assignment, which is where the bug usually is

Compact layouts are assigned per record type. There is a primary compact layout for the object, used where no record type assignment applies, and then one assignment per record type. There is no assignment by profile, by app or by user. If different teams need different headers on the same record type, the compact layout cannot give you that.

The assignment lives on the object metadata rather than on the compact layout, which is why a deployment that includes the layout but not the assignment leaves production looking unchanged:

<compactLayoutAssignment>Support_Header</compactLayoutAssignment>
<recordTypes>
    <fullName>Support_Case</fullName>
    <compactLayoutAssignment>Support_Header</compactLayoutAssignment>
</recordTypes>

Check the assignment before you check anything else. Create a record of the relevant record type and compare it with one of another type. If the headers differ, you have your answer in thirty seconds.

Why the highlights panel shows the wrong fields

Work through these in order.

  • Wrong record type assignment. The single most common cause, and the easiest to prove.
  • Field order. The panel renders from the top of the compact layout and stops when it runs out of room. Fields eight, nine and ten are frequently invisible on a laptop and always invisible on a phone.
  • Field-level security. A field the running user cannot read is skipped, and the panel closes the gap silently. Your header looks different to different users, which is correct behaviour and confusing to diagnose.
  • The Dynamic Highlights Panel. If the record page uses this component instead of the standard one, fields are chosen on the Lightning page and the compact layout is not consulted for them. Open the page in App Builder before concluding the layout is ignored.
  • A blank field. Empty values still occupy a slot in most contexts, which is a reason to avoid sparsely populated fields here.

How to choose the ten

Ask what someone needs to know to decide whether this is the right record and what to do next. Owner, stage or status, a value, a date, and one identifier is a good skeleton. Everything else is a field the user can scroll to.

Resist mirroring the top of the page layout. Duplicating the first six fields of the detail section makes the user read the same information twice, and it wastes the most valuable space on the page.

Frequently asked

Can I have a different compact layout per profile? No. Record type is the only dimension. The Dynamic Highlights Panel on a Lightning record page is the workaround, because Lightning pages can be assigned by app, record type and profile together.

Do formula fields work in a compact layout? Yes, and they are a good way to combine two values into one slot. Bear in mind that a formula field is recalculated on read, so a heavy cross-object formula in the header is evaluated on every record view.

Why does my new field not appear? Adding a field to the object does not add it anywhere. Edit the compact layout, save, and confirm the assignment covers the record type you are testing with.

Does the compact layout affect what the API returns? No. It is presentation only. Reports, queries and integrations ignore it, which also means it grants and hides nothing security-wise.