How do we manage our roles in Salesforce DX?

We currently have about 700 roles in production, which is more than the default 500 roles allowed for an org. When trying to create a scratch org, this means that we can’t push all of our roles. Technically, this isn’t a problem, because we only get five user licenses anyways, but how do we maintain our user roles if we can’t push all of them at once?

Can we specify in the Scratch Org Definition file that we want a higher limit (e.g. 1,000), or do we need to maintain different artifacts for the various branches? Also, since they all have a common root, how do we maintain this common ancestor? You may assume that we’re attempting to migrate to DX packaging, so I presume that we’d maintain multiple, dependent packages for this, but it still seems overly complicated.


You might already be aware of this: This new document states: “In Salesforce Orgs created in Spring ’21 or later, you can create up to 5,000 roles.”

I’ve just created 1,000 roles in an (Enterprise Edition) scratch org via Apex, and repeated the same via sfdx force:data:bulk:upsert – successfully.

Source : Link , Question Author : sfdcfox , Answer Author : Felix van Hove

Leave a Comment