[SalesForce] How to push 500 Custom Objects into Scratch Org

On our Production Org, we have Performance Edition where we are allowed to have 2000 custom objects but we have around 500. Actually 676. Anyway. We are trying to migrate our internal production support project into DX and we are trying to push source of full sandbox into scratch org, but we receive a lot of errors including "reached maximum number of custom objects". It must be because we can create scratch org at most of Enterprise edition which supports 200 custom objects and we are definitely exceeding this limit.

We were thinking about splitting our internal org customization into separate artifacts, but it is tedious and complicated task, since we have a lot of interdependent functionality and we simply really struggle to separate functionalities we have since they depend on each other and as far as I understand, when you are working with artifacts, you can't have both Artifact A depend on Artifact B and vice versa, while in our case everything is really messed up and everything depend on everything.

Has anyone overcome the similar issue? What is the resolution to this?

Best Answer

From what I've heard, DX team is working on allowing us to specify limits like this in scratch orgs (e.g. increase maximum Role limit, Workflow Rule limit, etc), but we don't have a date as to when that will happen. Also, using Org Shape (still in pilot) should allow you to set the same limits you have in production.

For now, the two solutions are either: (a) get on Org Shape pilot, if you can, or (b) make multiple packages. What you'll probably need is a solution where you have several base packages that contain all the objects, and additional artifacts that contain your code, etc. While it's true that you can't have recursive dependencies, you can have an artifact exist in more than one package, as far as I've seen.

You'll want to read this blog post as it directly relates to your question, as well as the entire four-part series (links are in the post).

Related Topic