Salesforce Compact Layout design and management. Use when selecting fields for the highlights panel, creating visual indicators, or deploying compact layouts via CLI/API. Covers mobile optimization and record type assignments.
From opspal-salesforcenpx claudepluginhub revpalsfdc/opspal-commercial --plugin opspal-salesforceThis skill is limited to using the following tools:
field-selection.mdindicator-patterns.mdDesigns and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Activate this skill when the user:
A Compact Layout defines the key fields shown in:
It's the "business card" of a record - showing the most critical information at a glance.
Compact layouts display approximately 4-5 fields (varies by screen size). Choose wisely:
Selection Criteria:
When selecting fields, score each candidate:
| Criterion | Weight | Question |
|---|---|---|
| Identification | 30% | Does this help identify the record? |
| Actionability | 25% | Can users take action from this field? |
| Frequency | 20% | How often do users need this info? |
| Decision Impact | 15% | Does this influence user decisions? |
| Uniqueness | 10% | Does it show something not obvious from Name? |
Recommended Fields (4):
Rationale: Phone enables immediate action; Industry/Rating provide quick context without opening the full record.
Recommended Fields (4-5):
Rationale: Contact methods are essential for quick action. Opt-out indicators prevent compliance violations.
Recommended Fields (4):
Rationale: These four fields summarize the deal's value, timing, and status without opening the record.
Recommended Fields (4):
Recommended Fields (4):
Recommended Fields (4):
Recommended Fields (3):
Formula fields with images or icons can convey status information visually in the compact layout. This is especially powerful for:
Field Name: DoNotCall_Indicator__c
Type: Formula (Text)
Formula:
IF(DoNotCall,
IMAGE("/img/samples/flag_red.gif", "Do Not Call", 16, 16),
IMAGE("/img/samples/flag_green.gif", "OK to Call", 16, 16)
)
Display: Red flag (do not call) or Green flag (OK to call)
Field Name: EmailOptOut_Indicator__c
Type: Formula (Text)
Formula:
IF(HasOptedOutOfEmail,
IMAGE("/img/samples/flag_red.gif", "Email Opt Out", 16, 16),
IMAGE("/img/samples/flag_green.gif", "OK to Email", 16, 16)
)
Field Name: Contact_Status_Icons__c
Type: Formula (Text)
Formula:
"Call: " & IF(DoNotCall,
IMAGE("/img/samples/flag_red.gif", "No", 12, 12),
IMAGE("/img/samples/flag_green.gif", "Yes", 12, 12)) &
" Email: " & IF(HasOptedOutOfEmail,
IMAGE("/img/samples/flag_red.gif", "No", 12, 12),
IMAGE("/img/samples/flag_green.gif", "Yes", 12, 12))
Field Name: Priority_Indicator__c
Type: Formula (Text)
Formula:
CASE(Priority,
"High", IMAGE("/img/samples/color_red.gif", "High Priority", 12, 12),
"Medium", IMAGE("/img/samples/color_yellow.gif", "Medium Priority", 12, 12),
"Low", IMAGE("/img/samples/color_green.gif", "Low Priority", 12, 12),
""
)
# Single compact layout
sf project retrieve start -m "CompactLayout:Account.Account_Compact_Layout"
# All compact layouts for an object
sf project retrieve start -m "CompactLayout:Account.*"
# All compact layouts in org
sf project retrieve start -m CompactLayout
# Single layout
sf project deploy start -m "CompactLayout:Account.Account_Compact_Layout"
# With object (for assignment)
sf project deploy start -m "CompactLayout:Account.Account_Compact,CustomObject:Account"
Location: compactLayouts/Object.LayoutName.compactLayout-meta.xml
Structure:
<?xml version="1.0" encoding="UTF-8"?>
<CompactLayout xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Account_Compact</fullName>
<label>Account Compact Layout</label>
<fields>Phone</fields>
<fields>Industry</fields>
<fields>OwnerId</fields>
<fields>Rating</fields>
</CompactLayout>
Fields appear in the order listed in the XML. Put most important fields first.
Set in the CustomObject metadata:
<CustomObject>
<compactLayoutAssignment>Account_Compact</compactLayoutAssignment>
</CustomObject>
<CustomObject>
<compactLayoutAssignment>Account_Compact</compactLayoutAssignment>
<recordTypes>
<fullName>Enterprise</fullName>
<compactLayoutAssignment>Enterprise_Compact</compactLayoutAssignment>
</recordTypes>
</CustomObject>
Include CustomObject when deploying:
sf project deploy start -m "CompactLayout:Account.Account_Compact,CustomObject:Account"
For detailed guidance, see:
field-selection.md - Field selection by objectindicator-patterns.md - Visual indicator formulas