The org capitalize record types
variable in Salesforce CLI is a useful configuration option to ensure consistent capitalization in record type names in scratch orgs. By default, this setting capitalizes the first letter of default record types, which can be crucial when installing packages that create or deploy record types. This guide walks through how to use
to streamline development workflows in Salesforce.org capitalize record types
org capitalize record types Configuration Variable
The org-capitalize-record-types
variable in Salesforce CLI controls capitalization of default record type names during scratch org creation. Here’s why it’s essential:
- Default Value: Set to
true
by default, ensuring that the first letter of each record type name in a scratch org is capitalized. - Capitalization Enforcement: When packages involving record types are deployed, this setting helps maintain consistent naming conventions across environments, reducing errors.
- Customization: Custom record types allow for specialized fields, page layouts, and even business logic, making them highly useful for different user scenarios.

Set org-capitalize-record-types
to true
before installing packages that include record types to enforce capitalization.
2. How to Set org-capitalize-record-types Variable in Salesforce CLI
To configure the org-capitalize-record-types
variable, follow these steps in Salesforce CLI:
Step-by-Step Commands
- Check Current Value: Run the following command to view the current setting:
sfdx config:get org-capitalize-record-types
- Set Capitalization Enforcement: Enable capitalization by setting the variable to
true
:
sfdx config:set org-capitalize-record-types=true
- Unset Variable (Optional): Reset to default by unsetting the variable:
sfdx config:unset org-capitalize-record-types
- Verify Configuration: Confirm the variable is set correctly:
sfdx config:list
3. Why org-capitalize-record-types is Important for Packages
When working with packages or metadata involving record types, it’s recommended to set org-capitalize-record-types
to true
for consistent naming. Here’s why:
- Error Prevention: Without enforced capitalization, record types may mismatch expected naming conventions in packages, potentially causing deployment errors.
- Consistency Across Environments: This setting helps maintain uniform record type names across all orgs, which is essential for collaborative projects or CI/CD workflows.
4. Salesforce Record Types & Best Practices
- Limit Per Object: Avoid creating more than 200 record types per object to prevent performance issues and manage complexity.
- Customization: Customize record types to align with business needs, including unique fields, layouts, and processes for different users.
- Metadata Management: Use Salesforce CLI and version control to track record type changes, ensuring consistent development and production environments.
5. Debugging org-capitalize-record-types Common Issues
- Check Configurations: Run
sfdx config:list
to ensure the variable is set totrue
. - Verify Package Dependencies: Confirm naming conventions are consistent when deploying packages that use specific record type names.
- Recreate Scratch Org: If capitalization isn’t applied, delete and recreate the scratch org to apply the configuration.
Conclusion
Using the org-capitalize-record-types
variable in Salesforce CLI helps enforce consistent record type capitalization in scratch orgs. This setting prevents naming inconsistencies, reduces deployment issues, and supports streamlined workflows in Salesforce development. By following best practices and ensuring capitalization, developers can enhance record type management and maintain a smooth development process across environments.