Scratch org creation fails with a default record type for Opportunity object in a definition file
Last updated 9 days ago ·Reference W-8937157 ·Reported By 3 users
In Review
Summary
When including a default record type for the lead object in scratch org definition file you will see the error:
"Opportunity.DefaultProcess: Cannot specify a default on: Opportunity"
Similarly, we will see a different error with the Lead object which is reflected in another Known Issue 27168
Repro
1. Use the scratch org definition sample file from our documentation (with object settings) like below:
{
"orgName": "MyCompany",
"edition": "Developer",
"features": ["Communities", "ServiceCloud"],
"settings": {
"communitiesSettings": {
"enableNetworksEnabled": true
}
}
"objectSettings": {
"opportunity": {
"sharingModel": "private",
"defaultRecordType": "default"
},
"account": {
"defaultRecordType": "default"
}
}
}
Documentation sample link:
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file.htm
2. Create a scratch org and see the error:
"Opportunity.DefaultProcess: Cannot specify a default on: Opportunity"
NOTE: If packages are referencing the above scratch org definition file in their package:version:create commands, it will also fail.
Workaround
Remove the line: "defaultRecordType": "default" from scratch org definition file and retry.
Reported By (3)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.
