RecordType defines an object-specific variant of business processes, available picklist values, and page layouts offered to users. It is configuration, not a separate object or a record-security boundary. Definitions can appear within CustomObject.recordTypes or be addressed individually through Metadata API.
Do not confuse this metadata definition with the runtime RecordType sObject, the queryable Salesforce object that exposes record type information, or with Schema.RecordTypeInfo, the Apex interface for describing record types. Runtime IDs and display labels are not metadata component names.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The deployment identity. Required for creation, update, and deletion. An independently addressed component uses an object-qualified name such as ExpenseReport__c.Edit; inside CustomObject.recordTypes, use the local name, such as Edit. |
active |
Required Boolean indicating whether the definition is active. Activation does not assign the record type to users. |
label |
Required user-facing descriptive text. It is not the component's deployment identity. |
description |
A description of up to 255 characters. Users with access to the object can read its record type information, so this is not a place for sensitive information. |
businessProcess |
The bare name of a BusinessProcess, without an object prefix. Required for Lead, Opportunity, Solution, and Case record types; not allowed for other objects. |
compactLayoutAssignment |
The assigned CompactLayout. This is a compact-layout assignment, not a full page-layout definition. |
picklistValues |
A collection of picklists and the choices available for this record type. These entries do not replace the field or value-set definitions. |
picklistValues.picklist |
Required within each entry. Identifies the picklist being configured, with a dependency on CustomField or StandardValueSet, as applicable. |
picklistValues.values.fullName |
Identifies an available picklist value, not another record type. Each values entry belongs to the picklist named by picklist. |
picklistValues.values.default |
A Boolean flag identifying the default picklist choice. It does not designate the user's default record type. |
Behavior and Constraints
Activation and user assignment are separate
active records whether the definition is active. It does not establish which users can select it. Profile assignment governs record-type availability for create and edit operations, so an active definition alone is not a complete user assignment.
Record types do not restrict read access. A user whose profile is not enabled for a particular record type can still access records of that type when otherwise authorized. Do not use record-type assignment as a substitute for record access controls.
Users with access to an object can read all record type information for that object. Do not put sensitive information in fullName, label, or description; store it in appropriately secured objects or fields instead.
Names have different purposes
The local record type name must be unique, begin with a letter, and contain only alphanumeric characters and underscores. It cannot contain spaces, end with an underscore, or contain consecutive underscores. These restrictions apply to the local record type name, not to the object-qualified component name as a whole.
The naming rule for businessProcess is different. For example, use the bare process name Bulk Orders, not an object-prefixed name. Do not copy the object-qualified RecordType naming convention into this element.
Picklist choices and record-type defaults are different settings
Each picklistValues entry identifies a picklist and lists the choices available for this record type. The nested fullName identifies a picklist choice, and the nested default flag concerns that choice. Neither identifies a user's default record type.
A describe result, which exposes runtime information about an object, also has a different role from this definition. A community report describes isDefaultRecordTypeMapping() as reflecting the invoking user's profile. It is not an organization-wide default stored in RecordType, and it does not by itself identify another record owner's default.
Deployment and Retrieval
Select components by their object-qualified names
RecordType does not support * as a member in package.xml, the manifest that selects metadata for deployment or retrieval. Select individual members with object-qualified names, such as ExpenseReport__c.Edit.
Metadata API supports creating, updating, and deleting definitions. Supply fullName for each operation; changing or supplying a label is not a substitute for identifying the component. Within a CustomObject.recordTypes entry, the same definition uses its local name.
Retrieve assignment configuration separately from the definition
Retrieving a RecordType together with Profile or PermissionSet components causes that record type to appear in those retrieved permission components. This changes the scope of the retrieved output; it does not change access in the org.
A definition retrieved without its assignment configuration does not establish which users can use it. Conversely, a record type appearing in retrieved permission metadata does not mean the retrieval assigned it to anyone.
Include the picklist fields needed for the retrieval
Retrieving a record type does not automatically retrieve the specific picklist fields associated with it. Record-type-specific availability entries are not substitutes for the associated field and value-set definitions.
A selective-retrieval report also described missing record-type picklist mappings when the relevant fields or containing object were not requested. The targeted approach was to request explicit RecordType and CustomField members together, without requesting the entire CustomObject. For example, a manifest can select Opportunity.RecordType1 under RecordType and Opportunity.Field1__c under CustomField.
The same discussion reported change sets as an option for selecting particular fields and record types. Treat the missing mappings as a retrieval-scope question before concluding that the source definition lacks them.
Account for the person account picklist limitation
When a picklist exists on Contact, Metadata API does not retrieve its custom picklist values on person account record types. It retrieves standard picklist values only. Missing custom values in this retrieval are therefore not proof that the source configuration lacks those values.
Check consumers before renaming or removing a definition
A record type can be consumed by permission assignments, presentation settings, guided experiences, actions, service configuration, and automation. These consumers are separate components, not children contained in RecordType. Their actual references determine whether a rename or removal affects them.
Runtime integrations require a separate check: a source org's RecordTypeId is not a portable metadata identity. A deployment test failure has been reported when the sandbox and production IDs differed despite matching definitions.
Relationships
CustomObject.recordTypes contains record type definitions. Profile retrieval also carries record-type configuration when scoped to the selected definitions. These containment and retrieval connections are separate from the element references below.
The outgoing references identify business-process, compact-layout, and picklist dependencies. Incoming references identify possible consumers; their presence in the schema does not establish that a particular component in an org uses this record type.
References
-
BusinessProcess:businessProcess. -
CompactLayout:compactLayoutAssignment. -
CustomField:picklist. -
StandardValueSet:picklist.
Referenced By
-
AnimationRule:recordTypeName. -
CareRequestConfiguration:careRequestRecordType. -
ChannelLayout:recordType. -
CustomApplication:recordType. -
CustomObjectTranslation:namein record-type translation entries. -
EntitlementProcess:recordType. -
MutingPermissionSet:recordType. -
PathAssistant:recordTypeName. -
PermissionSet:recordType. -
Prompt:targetRecordType. -
QuickAction:targetRecordType. -
UIObjectRelationConfig:contextObjectRecordType,relatedObjectRecordType. -
Workflow:lookupValue. -
WorkflowFieldUpdate:lookupValue.
Reported Issues
-
Selective retrieval can appear to lose picklist mappings. In a 2020 report, retrieving record types without the relevant fields omitted expected picklist configuration, while requesting the containing object brought in more record types than wanted. The answer recommended selecting explicit
RecordTypeandCustomFieldmembers together without the whole object, and also described change sets as a selective option. Selective retrieval discussion. -
Hardcoded IDs can cause deployment tests to fail. A 2017 sandbox-to-production report traced a failure to different
RecordTypeIdvalues in the two environments. Resolve the record type in the destination object's context rather than assuming the source ID is portable. Deployment test failure. -
Label-based runtime lookups can break after renaming or translation. A 2017 discussion distinguishes runtime
Name, the display label, fromDeveloperName, the API name. Answers warn that labels can change or be translated. Resolve the record type in its object's context instead of treating a display label as a portable identifier. Name and DeveloperName discussion. -
A describe result can return the invoking user's default rather than the intended owner's default. A 2013 report explains that
isDefaultRecordTypeMapping()reflects the profile of the user performing the describe. Assigning a different owner does not make that result describe the owner's default. User-context default explanation. -
Creating or deleting record types as ordinary Apex test data can fail with "DML not allowed on RecordType". Reports describe an attempted
insertin 2015 and an attempteddeletein 2012. DML means ordinary record operations such as insert, update, and delete. These reports concern the runtime sObject interface, not Metadata API's ability to create, update, or delete definitions. Test-time creation report and Test-time deletion report. -
A trigger can have
RecordTypeIdwithout a populatedRecordType.Name. A 2013 report explains that trigger records contain their own fields, not automatically loaded fields from related records. Answers describe querying the related record type information or using the object's describe information to resolve the name by ID. Missing name in a trigger. -
A query can reject the
RecordTyperelationship when the object has no defined record types. In a 2021 report,RecordType.Nameworked for Account but not Opportunity. The answer attributed this to the absence of a defined Opportunity record type and therefore the relationship field needed to traverse toRecordType. Relationship query report.
Common Questions
Can I retrieve all record types with a wildcard in package.xml?
No. RecordType does not support * as a manifest member. Specify individual object-qualified names, such as ExpenseReport__c.Edit.
Why are picklist values missing from my retrieved record type?
Retrieving a record type does not automatically retrieve its picklist fields. A selective-retrieval report recommends requesting the explicit record types and relevant CustomField members together. For person account record types, Contact-based picklists also have a documented limitation: custom values are not retrieved, while standard values are.
Why can't users select an active record type?
active and user assignment are separate settings. An active definition alone does not establish availability; profile assignment governs record-type availability for create and edit operations.
Can record types stop users from reading certain records?
No. Record-type assignment is not a read-access boundary. Users can read records of an unassigned record type when otherwise authorized, and users with object access can read all record type information for that object.
Can I insert a RecordType in an Apex unit test?
Ordinary Apex insert has been reported to fail with "DML not allowed on RecordType". Metadata API creation support does not mean a record type definition can be inserted as ordinary Apex test data.