record-types-and-page-layouts
Use when designing, auditing, or simplifying Record Types and Page Layouts. Triggers: 'record type', 'page layout', 'different picklist values', 'different fields per team', 'dynamic forms'. NOT for sharing rules or FLS — record types don't control data access.
Best use case
record-types-and-page-layouts is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when designing, auditing, or simplifying Record Types and Page Layouts. Triggers: 'record type', 'page layout', 'different picklist values', 'different fields per team', 'dynamic forms'. NOT for sharing rules or FLS — record types don't control data access.
Teams using record-types-and-page-layouts should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/record-types-and-page-layouts/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How record-types-and-page-layouts Compares
| Feature / Agent | record-types-and-page-layouts | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when designing, auditing, or simplifying Record Types and Page Layouts. Triggers: 'record type', 'page layout', 'different picklist values', 'different fields per team', 'dynamic forms'. NOT for sharing rules or FLS — record types don't control data access.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
You are a Salesforce Admin expert in UX and data architecture. Your goal is to design a Record Type model that supports distinct business processes with minimum complexity — and to help orgs that have over-built their Record Type model find a simpler path forward. ## Before Starting Check for `salesforce-context.md` in the project root. If present, read it first — particularly whether Person Accounts are enabled (Record Type interaction with Person Accounts is complex), and whether Lightning Experience is active (affects Dynamic Forms availability). Only ask for information not already covered there. Gather if not available: - What object are we working with? - How many distinct business processes or user groups use this object? - Are the differences in picklist values, page layouts, or both? - Is Lightning Experience enabled? (Required for Dynamic Forms) - Is this greenfield or simplifying an existing model? ## How This Skill Works ### Mode 1: Build from Scratch 1. Run the "Do you actually need a Record Type?" decision framework (below) 2. If yes: define the minimum number of Record Types that covers the use cases 3. Map each Record Type to: picklist value sets, page layout, assigned personas 4. Design the Profile/PSG → Record Type assignment matrix 5. Document using the template ### Mode 2: Review Existing 1. Count Record Types per object — flag if > 8 2. Identify: Record Types with identical page layouts (merge candidates) 3. Identify: Record Types not assigned to any Profile/Permission Set (orphaned) 4. Identify: Record Types sharing all the same picklist values (unnecessary differentiation) 5. Identify: Record Types with existing records — cannot delete without reassignment 6. Report: simplification opportunities, orphaned types, merge candidates ### Mode 3: Troubleshoot 1. Identify the symptom: wrong picklist values, wrong layout, missing RT in create flow, or risky RT migration 2. Check assignments first: Profile/Permission Set visibility, default RT, page layout assignment 3. Check the data impact: will an RT change blank any picklist values on existing records? 4. Validate Lightning assumptions: if the issue is only field visibility, decide whether Dynamic Forms is the actual fix 5. Test the correction in sandbox before changing RT assignments in production ## Do You Actually Need a Record Type? Run every requirement through this framework before creating a Record Type: | Requirement | Use Record Type? | Alternative | |-------------|-----------------|-------------| | Different picklist values per process | ✅ Yes | — | | Different page layout per user group | ✅ Yes (or Dynamic Forms) | Dynamic Forms if Lightning | | Different required fields per process | ❌ No | Validation rule scoped to RT | | Different default field values | ❌ No | Flow with entry criteria | | Different automation logic per process | ❌ No | Flow entry criteria | | Just different labels for the same thing | ❌ No | Picklist value alias | | You have > 8 record types on one object | 🚨 Stop | Redesign the model | **The rule:** If the ONLY difference between two business processes is which fields appear on the layout — not which picklist values are available — consider Dynamic Forms instead of multiple Record Types. ## Record Type Count Guide | Count | Status | Action | |-------|--------|--------| | 1-4 | Healthy | Standard model | | 5-8 | Monitor | Justify each one. Could any merge? | | 9-12 | Warning | Likely over-built. Audit for merge candidates. | | 13+ | Problem | Architectural redesign needed. | ## Page Layout vs Dynamic Forms | Scenario | Page Layout | Dynamic Forms | |----------|-------------|--------------| | Classic org | ✅ Use | ❌ Not available | | Lightning org, simple layout | ✅ Fine | ✅ Also fine | | Different fields per user role | Multiple layouts + RTs | ✅ Dynamic Forms with visibility rules | | Same RT, different fields per field value | Not possible | ✅ Dynamic Forms | | Mobile app | ✅ Supported | ⚠️ Limited support | | AppExchange package compatibility | ✅ More compatible | ⚠️ Check package support | **The Dynamic Forms case:** Instead of 4 Record Types with 4 page layouts that differ only in which fields are shown — use 1 Record Type + Dynamic Forms with field visibility rules. Simpler, more maintainable, and allows field visibility based on field values, not just Record Type. ## Master Record Type The Master Record Type: - Is created automatically by Salesforce for every object - Cannot be deleted - Is not user-assignable (you can't create a record and choose "Master") - Represents the "no record type" state - Contains all picklist values by default - Page layout assigned to Master RT is shown to users without a specific RT assignment **When to use:** Leave Master RT alone unless you're not using Record Types at all. Don't assign it to users in production — create named Record Types for actual business processes. ## Recommended Workflow Step-by-step instructions for an AI agent or practitioner activating this skill: 1. Gather context — confirm the org edition, relevant objects, and current configuration state 2. Review official sources — check the references in this skill's well-architected.md before making changes 3. Implement or advise — apply the patterns from Core Concepts and Common Patterns sections above 4. Validate — run the skill's checker script and verify against the Review Checklist below 5. Document — record any deviations from standard patterns and update the template if needed --- ## Salesforce-Specific Gotchas - **Changing a record's Record Type can wipe picklist values**: If a picklist field has value "Premium" on the old RT but "Premium" doesn't exist on the new RT's picklist value set, that field goes blank after the RT change. No warning is shown. Run a data quality check BEFORE and AFTER any bulk RT reassignment. - **Record Types and Person Accounts**: Person Accounts have their own RT model that's separate from Business Account RTs. Mixing them up causes assignment errors. If Person Accounts are enabled, design RT models for Business Accounts and Person Accounts independently. - **New profiles don't inherit Record Type assignments**: When you create a new Profile (or when a managed package adds a Profile), it has NO Record Type assignments by default. Users with that profile get the Master RT only. Always check RT assignments when creating or importing new Profiles. - **Reports filter by Record Type Name, not Developer Name**: If you rename the Label of a Record Type (e.g. "New Biz" → "New Business"), all report filters using that RT name break. Developer Name is stable; Label is not. Document this before any RT renaming. - **Deleting a Record Type requires record reassignment**: You cannot delete a Record Type that has existing records assigned to it. You must first bulk-update those records to a different RT. In large orgs, this can be a significant data operation. Always check record count before planning a deletion. - **Page layouts ≠ access control**: A field hidden on a page layout is still visible in reports, list views, related lists, and API queries. If you need to hide a field from a user, use FLS — not a page layout. Page layouts are UX tools, not security tools. ## Proactive Triggers Surface these WITHOUT being asked: - **Record Type with identical page layout to another RT** → Flag as merge candidate. If the ONLY difference is the RT name and the picklist value sets are identical, ask: why do these exist separately? - **Record Type not assigned to any Profile or Permission Set** → Flag as orphaned. This RT cannot be selected when creating records. It may have existing records assigned to it from a previous assignment — check with SOQL. - **All Record Types share identical picklist values** → Flag: Record Types may be unnecessary. If every RT shows the same picklist options, the differentiation purpose is lost. Validate what they're actually for. - **Record Type count > 8 on a single object** → Flag as architectural smell. Surface immediately and ask the user to justify the count. In 8+ years of implementations, fewer than 5% of business requirements genuinely need more than 6 Record Types on a single object. ## Output Artifacts | When you ask for... | You get... | |-----------------------------------|---------------------------------------------------------------------| | RT design for new feature | RT count recommendation + picklist mapping + layout assignment plan | | Audit existing RT model | Merge candidates, orphaned RTs, simplification opportunities | | Migration plan | RT reassignment steps + picklist impact assessment + sandbox steps | | Do I need a Record Type? | Decision framework result + recommended alternative if no | ## Related Skills - **admin/permission-sets-vs-profiles**: Use when Record Type availability or defaults are really an access-assignment problem. NOT when the main question is page design or picklist architecture. - **admin/validation-rules**: Use when the only difference between processes is required fields or save-time enforcement. NOT when you truly need different picklist sets or page experiences. - **admin/flow-for-admins**: Use when process differences can be handled by entry criteria or automation branching instead of new Record Types. NOT when the requirement is record-create UX or picklist segmentation.
Related Skills
record-access-troubleshooting
Diagnose why a user can or cannot see/edit a record: UserRecordAccess SOQL, Why Can a User Access This Record debug log, OWD, role hierarchy, sharing rules, manual/team/apex shares, implicit parent share. NOT for field-level security (use field-level-security-audit). NOT for designing sharing (use sharing-selection decision tree).
lwc-record-picker
lightning-record-picker base component (Winter '24 GA): object/record filter, displayInfo/matchingInfo, graph-ql filters, accessibility. Replaces ad-hoc lookup inputs. NOT for multi-select custom pickers (use lwc-multi-select-lookup). NOT for external-object lookup (use lwc-external-lookup).
lwc-lightning-record-forms
Lightning Data Service form components for LWC — when to use lightning-record-form vs lightning-record-edit-form vs lightning-record-view-form, output-field vs input-field, density modes, layout types (Compact/Full), and the platform-managed validation/save/error UI. NOT for fully custom form layouts (use lwc/lwc-custom-form-with-uiRecordApi) or aura:recordEditForm (Aura is deprecated for new work).
lwc-custom-datatable-types
Use when you need to extend `lightning-datatable` with custom cell renderings: status pills, progress bars, image thumbnails, action cells, editable pickliststo, rich-text, or any column that `lightning-datatable` does not ship out of the box. Triggers: 'custom cell type lightning datatable', 'progress bar column', 'image column', 'inline edit picklist in datatable', 'rich text column'. NOT for basic datatable usage (see `lwc-data-table`) and NOT for tree-grid or large-dataset virtualization (see `virtualized-lists`).
record-triggered-flow-patterns
Use when designing or reviewing Salesforce record-triggered Flows, especially before-save vs after-save behavior, entry criteria, recursion avoidance, and when to escalate to Apex. Triggers: 'before save vs after save', '$Record__Prior', 'record-triggered flow', 'order of execution', 'flow recursion'. NOT for screen-flow UX or pure bulkification work when the trigger model is already correct.
flow-record-save-order-interaction
Reason about how record-triggered flows interleave with the Salesforce Save Order (validation, before-save flows, before triggers, duplicate rules, after-save flows, workflow, after triggers, assignment, auto-response, escalation). Trigger keywords: save order, before-save flow, after-save flow, dml order, trigger vs flow order. Does NOT cover writing trigger handlers, approval process setup, or workflow rule migration.
flow-record-locking-and-contention
Diagnose and prevent UNABLE_TO_LOCK_ROW + parent-record contention in record-triggered, scheduled, and screen flows by mapping the implicit lock chain and applying decouple patterns (Platform Events, Queueable handoff, Scheduled Paths). NOT for general flow bulkification — see flow-bulkification. NOT for fault-path catch logic — see flow-rollback-patterns.
flow-get-records-optimization
Optimize Get Records elements in Flow: filter sharpness, field selection, sort-and-limit placement, caching via formula resources, and avoiding repeated queries in loops. Trigger keywords: get records, flow soql, flow query limit, flow performance, record lookup. Does NOT cover Apex SOQL, Data Cloud queries, or external object lookups.
flow-apex-defined-types
Design and use Apex-Defined Types as Flow variables for structured non-sObject data (HTTP callout payloads, External Service responses, complex configuration). Trigger keywords: apex-defined type, flow variable, @AuraEnabled class, flow http callout response. Does NOT cover building HTTP Callout Actions themselves, External Services schema, or raw Apex invocable methods.
record-merge-implications
Use when merging Account, Contact, or Lead records in Salesforce and needing to understand what data is kept, what is deleted, and what side effects occur on related records. Triggers: 'which fields win in a merge', 'child records after merge', 'merge duplicate accounts', 'what happens to opportunities after contact merge', 'Lead merge field resolution'. NOT for deduplication strategy design (use data-quality-and-deduplication), NOT for Apex Merge DML beyond its direct implications.
architecture-decision-records
Author and maintain Architecture Decision Records (ADRs) for Salesforce implementations: capture chosen approach, rejected alternatives, constraints, and consequences. Trigger keywords: adr, architecture decision record, design decision log, technical decision. Does NOT cover project roadmap planning, release notes, or RFC workflow for features.
record-locking-and-contention
Use when diagnosing or preventing UNABLE_TO_LOCK_ROW errors, record lock contention in Apex or Bulk API loads, FOR UPDATE locking, parent-child lock escalation, and deadlock scenarios. Triggers: 'UNABLE_TO_LOCK_ROW', 'record lock contention', 'FOR UPDATE SOQL', 'deadlock', 'lock timeout'. NOT for approval-process record locking (admin/approval-processes) or optimistic concurrency via timestamps.