本文へ移動
cccskills
無料GitHub で公開

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', 'business process', 'recordTypeVisibilities', 'layoutAssignments', 'record type deploy failed', 'businessProcess required', 'layout assignment matrix'. NOT for layout explosion across many profiles — use admin/record-type-strategy-at-scale. NOT for sharing rules — use admin/sharing-and-visibility. NOT for FLS — use admin/permission-sets-vs-profiles.

インストール方法を見る

含まれるファイル(37)

  • SKILL.md20.5 KB
  • references/examples.md3.6 KB
  • references/gotchas.md24.3 KB
  • references/llm-anti-patterns.md12.6 KB
  • references/metadata-examples.md21.7 KB
  • references/well-architected.md6.6 KB
  • scripts/check_record_type_layouts.py31.6 KB
  • scripts/fixtures/assign-negative/layouts/Claim__c-Claim Layout.layout-meta.xml568 B
  • scripts/fixtures/assign-negative/objects/Claim__c/recordTypes/Standard.recordType-meta.xml256 B
  • scripts/fixtures/assign-negative/permissionsets/Claim_Standard.permissionset-meta.xml360 B
  • scripts/fixtures/assign-negative/profiles/Agent.profile-meta.xml230 B
  • scripts/fixtures/assign-negative/README130 B
  • scripts/fixtures/assign-noscope/objects/Claim__c/recordTypes/Express.recordType-meta.xml257 B
  • scripts/fixtures/assign-noscope/objects/Claim__c/recordTypes/Standard.recordType-meta.xml256 B
  • scripts/fixtures/assign-noscope/README205 B
  • scripts/fixtures/assign-positive/layouts/Claim__c-Claim Layout.layout-meta.xml568 B
  • scripts/fixtures/assign-positive/objects/Claim__c/recordTypes/Standard.recordType-meta.xml256 B
  • scripts/fixtures/assign-positive/profiles/Agent.profile-meta.xml230 B
  • scripts/fixtures/assign-positive/README417 B
  • scripts/fixtures/merge-negative/layouts/Opportunity-Opportunity Enterprise Layout.layout-meta.xml1003 B
  • scripts/fixtures/merge-negative/layouts/Opportunity-Opportunity Renewal Layout.layout-meta.xml1.2 KB
  • scripts/fixtures/merge-negative/README136 B
  • scripts/fixtures/merge-positive/layouts/Opportunity-Opportunity Enterprise Layout.layout-meta.xml1003 B
  • scripts/fixtures/merge-positive/layouts/Opportunity-Opportunity Renewal Layout.layout-meta.xml1003 B
  • scripts/fixtures/merge-positive/README395 B
  • scripts/fixtures/req-closedate-unverified/layouts/Opportunity-Opportunity Enterprise Layout.layout-meta.xml953 B
  • scripts/fixtures/req-closedate-unverified/README339 B
  • scripts/fixtures/req-name-negative/layouts/Opportunity-Opportunity Enterprise Layout.layout-meta.xml957 B
  • scripts/fixtures/req-name-negative/README223 B
  • scripts/fixtures/req-name-positive/layouts/Opportunity-Opportunity Enterprise Layout.layout-meta.xml953 B
  • scripts/fixtures/req-name-positive/README285 B
  • scripts/fixtures/req-probability-negative/layouts/Case-Case Support Layout.layout-meta.xml858 B
  • scripts/fixtures/req-probability-negative/layouts/Opportunity-Opportunity Enterprise Layout.layout-meta.xml957 B
  • scripts/fixtures/req-probability-negative/README412 B
  • scripts/fixtures/req-probability-positive/layouts/Opportunity-Opportunity Enterprise Layout.layout-meta.xml820 B
  • scripts/fixtures/req-probability-positive/README365 B
  • templates/record-type-design-template.md5.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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?

Questions to Ask Before Configuring

Ask these before opening Object Manager. Each one maps to a way this model fails in production, and an LLM that skips them produces a record type that deploys cleanly and nobody can select.

AskWhy it mattersWhat a good answer adds
"Which picklist values differ between these processes, field by field?"If nothing differs, the requirement is a layout or a Dynamic Forms problem, not a record typeThe picklistValues blocks, and the evidence that a record type is warranted at all
"Is this object Lead, Opportunity, Solution, or Case?"Those four require a businessProcess; every other object forbids one, and both mistakes are deploy failuresWhether a BusinessProcess must be authored alongside the record type (gotchas #6)
"Which profile does each affected user actually hold?"Permission sets grant record type visibility only — the default record type and the page layout assignment exist solely on ProfileThe profile × record type × layout matrix, not a per-record-type layout list
"Do records already exist on the record type we are changing or retiring?"Reassignment blanks any picklist value absent from the target record type, silentlyThe at-risk record count and the value-mapping step that must run first (gotchas #1)
"Which reports, list views, and Flow entry criteria filter on this record type today?"Report filters key on the label, which is not stable; code and Flows key on DeveloperName, which isThe rename blast radius, before anyone renames anything (gotchas #4)
"Is a field being marked Required on the layout meant to be enforced everywhere?"Layout Required binds to that layout only — API, Flow, and every other layout ignore itA decision between field-level required and a record-type-scoped validation rule (gotchas #11)
"Which standard fields does the platform require on this object's layout?"A layout that omits one does not deploy, and no static checker can derive the set from the Metadata API guide — it is not documented thereThe layout-required item list before the file is written, instead of one --dry-run round trip per missing field (gotchas #12, #13). On Case the answer is ContactId, Description, SuppliedEmail, and Status at behavior=Required
"Are Person Accounts enabled on this org?"Person Account record types are a separate model, and the Metadata API will not round-trip their custom picklist valuesA separate design track and a manual verification step for the picklist matrix (gotchas #2, #9)

What a proper configuration adds over just creating the record type: the record type is selectable by the right users with the right default, every profile lands on an intended page layout instead of falling through to a default, the picklist matrix survives a scratch-org rebuild, and no existing record loses a field value on the way there.

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:

RequirementUse 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❌ NoValidation rule scoped to RT
Different default field values❌ NoFlow with entry criteria
Different automation logic per process❌ NoFlow entry criteria
Just different labels for the same thing❌ NoPicklist value alias
You have > 8 record types on one object🚨 StopRedesign 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

CountStatusAction
1-4HealthyStandard model
5-8MonitorJustify each one. Could any merge?
9-12WarningLikely over-built. Audit for merge candidates.
13+ProblemArchitectural redesign needed.

Page Layout vs Dynamic Forms

ScenarioPage LayoutDynamic Forms
Classic org✅ Use❌ Not available
Lightning org, simple layout✅ Fine✅ Also fine
Different fields per user roleMultiple layouts + RTs✅ Dynamic Forms with visibility rules
Same RT, different fields per field valueNot 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

  1. Justify the record type — run the "Do you actually need a Record Type?" table above. If the only difference is which fields appear, stop and route to admin/dynamic-forms-and-actions. Record the outcome in templates/record-type-design-template.md
  2. Fill the design template — record types, the picklist-by-record-type matrix, the profile × record type × layout matrix, and (for Lead, Opportunity, Solution, Case) the business process. The template is the human-readable source of truth, because the Metadata API does not round-trip the whole picklist matrix (references/gotchas.md #9)
  3. Write the metadata — copy the shapes in references/metadata-examples.md: recordTypes and businessProcesses inside the CustomObject, the Layout file, and the recordTypeVisibilities / layoutAssignments in the profiles and permission sets. Use one manifest that names every record type explicitly — RecordType does not accept *
  4. Check before deploying — python3 scripts/check_record_type_layouts.py --manifest-dir force-app/main/default (add --strict to fail on MEDIUM/LOW/INFO too; add --require-assignment to promote RTL-ASSIGN-01 from INFO to REVIEW). It flags layout assignments pointing at inactive record types, missing business processes on the four objects that need them, record types nobody can see, objects past the count threshold, identical layouts on the same object as REVIEW RTL-MERGE-01 (Mode 2 merge candidates), active record types with neither a Profile layoutAssignments nor any Profile/PermissionSet recordTypeVisibilities entry as INFO RTL-ASSIGN-01 (or one INFO when the tree holds no Profile/PermissionSet at all), and — as ERROR-severity RL-REQ-01 / RL-REQ-02 — a Case layout missing ContactId, Description, or SuppliedEmail, or whose Status item is absent or not Required (RL-REQ-03 is an ADVISORY heuristic for other standard objects); and — as HIGH-severity RTL-REQ-01 / RTL-REQ-02 — an Opportunity layout with no Probability item, or whose Name or StageName item is present with a behavior other than Required (org-verified 2026-09-18; CloseDate is an INFO carrying UNVERIFIED (2026-09-18), because run 4 proved the set is accepted, not that CloseDate is required). Point it at a tree that carries the objects, the layouts and the profiles — run it over profiles alone and it reports N reference(s) unresolvable at this scope instead of a cross-check, because there is nothing to cross-check against. Exit 1 means a CRITICAL/HIGH deploy-breaker
  5. Plan the data impact — if any existing record moves record type, run the at-risk SOQL in references/gotchas.md #1 and migrate the picklist values before the reassignment
  6. Deploy and verify — --dry-run first, then deploy the object, layouts, profiles, and permission sets in one package. Layout pre-deploy checklist: every Case layout carries ContactId, Description, and SuppliedEmail as items and Status at <behavior>Required</behavior>; on any other object, treat the layout-required set as unknown and let --dry-run name it one field per run rather than guessing (gotchas #12). Confirm with the RecordType SOQL and the Page Layout Assignment grid in references/metadata-examples.md
  7. Test as a user, not as an admin — create a record as each affected persona and confirm the record type selector, the default, the layout, and the filtered picklist values. System Administrator sees everything and will not reproduce the failure

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.
  • businessProcess is mandatory on four objects and banned everywhere else: Lead, Opportunity, Solution, and Case record types must name one; every other object rejects one. Both directions fail the deploy (references/gotchas.md #6).
  • A permission set cannot assign a page layout or a default record type: PermissionSet.recordTypeVisibilities carries only recordType and visible. layoutAssignments and default exist only on Profile, so a profile-free assignment model still leaves layouts on the profile (references/gotchas.md #8, references/metadata-examples.md).
  • Some standard fields are required on the layout itself, and only the deploy knows which: a Case layout without ContactId, Description, and SuppliedEmail, or with Status at anything but behavior=Required, fails sf project deploy start with four errors delivered one per run — while passing every static check. The Metadata API guide does not state the rule; the set for objects other than Case is unverified (references/gotchas.md #12, #13).
  • RecordType does not accept the * wildcard in package.xml: a wildcard manifest retrieves the object and its layouts but no record types, so a "full" source snapshot quietly omits them (references/metadata-examples.md).

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 featureRT count recommendation + picklist mapping + layout assignment plan
Audit existing RT modelMerge candidates, orphaned RTs, simplification opportunities
Migration planRT reassignment steps + picklist impact assessment + sandbox steps
Do I need a Record Type?Decision framework result + recommended alternative if no

Reference Files

FileRead it when
references/metadata-examples.mdWriting deployable RecordType, BusinessProcess, Layout, and profile/permission-set assignment XML, the layout-required standard fields, the package.xml, and the verification SOQL
references/gotchas.mdFifteen platform behaviours that cause most record type and layout incidents — picklist wipes, deploy failures, profile-diff noise, layout Required that enforces nothing, layout-required standard fields that fail the deploy rather than the checker, identical layouts after an undifferentiated record-type split, and deployable-but-unselectable types
references/examples.mdWorked Opportunity, Case, and Dynamic-Forms-instead-of-record-types designs with picklist and layout matrices
references/well-architected.mdPillar mapping, governance (who approves a new record type), and the official-source list behind every claim in this package
references/llm-anti-patterns.mdSelf-checking generated output — the seven ways an assistant gets record types and layouts wrong
templates/record-type-design-template.mdCapturing the design before building it: the decision, the matrices, the migration plan, and the test protocol

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.
  • admin/dynamic-forms-and-actions: Use when the only difference between processes is which fields appear, and the org is Lightning. NOT when picklist values differ by process.
  • admin/record-type-strategy-at-scale: Use when the record type and layout count has already exploded across many objects or profiles. NOT for designing a single object's model.
  • admin/record-type-id-management: Use when code, Flows, or data loads need to resolve a Record Type Id without hardcoding it. NOT for the design decision itself.
  • admin/picklist-and-value-sets: Use when the underlying value set (global vs local, restricted, dependent) is the real question. NOT for which record type exposes which subset.
  • admin/permission-set-architecture: Use when the assignment side needs designing — which permission set grants record type visibility, and which profile still owns the default and the layout.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use this skill when writing test-first, behavior-driven acceptance criteria in Given/When/Then format for a Salesforce user story. Covers happy path, edge cases, negative paths, permission boundaries, and data-state preconditions so the AC block can drive UAT scripts and Apex test design downstream. Trigger keywords: given when then, gherkin, behavior driven AC, test first acceptance criteria, scenario outline, BDD acceptance criteria. NOT for the user-story format itself (use admin/user-story-writing-for-salesforce). NOT for UAT script writing (use admin/uat-test-case-design). NOT for Apex test method generation (use agents/test-class-generator). NOT for high-level UAT planning (use admin/uat-and-acceptance-criteria). More triggers: acceptance criteria record, ac_id, req_id on a criterion, artefact under test, negative case for a rule-type requirement, no-match fall-through criterion, oracle for a Then clause, test type apex flow manual, criteria linter, check_ac_format.py, --manifest-dir.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Task and Event objects: polymorphic WhatId/WhoId, Activity object model, ActivityHistory vs OpenActivity, activity timeline customization, bulk task creation, Einstein Activity Capture boundaries. NOT for turning on EAC or calendar sync — use admin/einstein-activity-capture-setup. NOT for Email-to-Case — use admin/case-management-setup. Covers ActivitiesSettings metadata, enableActivities, shared Task/Event custom fields and FLS, TaskStatus value sets, Shared Activities and TaskRelation/EventRelation, recurring and child activities, and partial-success bulk DML on Task.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Design Invocable Apex actions that return deterministic, agent-friendly errors instead of surfacing raw exceptions to the LLM. NOT for authoring the action itself — @InvocableMethod schema, labels, security context — use agentforce/custom-agent-actions-apex. NOT for the Apex tests that force each error branch — use agentforce/agent-action-unit-tests.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Use when designing how an Agentforce agent extracts structured input parameters (slots) from a user's natural-language utterance to invoke an action. Triggers: 'agent extract date from user', 'agent action argument extraction', 'agentforce slot filling', 'agent invocable input mapping', 'agent fails to fill required parameter'. NOT for action authoring (use agentforce/agent-actions) or for prompt-template variable binding (use agentforce/prompt-builder-templates).

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Apex test patterns for @InvocableMethod agent actions: per-reason-code branch coverage, bulk safety, callout mocking, deterministic assertions. NOT for testing whether the agent routes to the right topic or answers well — use agentforce/agent-testing-and-evaluation. NOT for designing the error envelope the tests assert on — use agentforce/agent-action-error-handling.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

Designing or reviewing Agentforce actions: Flow actions, Apex invocable actions, prompt-template actions, action naming, input and output contracts, confirmation requirements, and safe error behavior. Triggers: 'agent actions', 'build an agent that can look up an order', 'make the agent able to check order status', 'give the agent a capability', 'agent that can retrieve a record', 'flow action for agent', 'agent invocable action', 'action schema design'. NOT for writing the Apex class itself — use agentforce/custom-agent-actions-apex. NOT for the reason_code error envelope that stops an agent retry loop — use agentforce/agent-action-error-handling.

日本語の概要は準備中です。原文の説明を表示しています。

PranavNagrecha/AwesomeSalesforceSkills192026年10月4日 更新

PranavNagrecha のスキルをすべて見る

このスキルの問題を報告する