The Background

We are a super-sized Performance Edition organization with a number of enhanced limits, and migrating our "happy soup" to DX Unlocked packages.

We previously had problems creating some of our Unlocked Packages, and eventually came up with a configuration file that allowed us to create these packages.

The Configuration

Our config file used for all of the packages is as follows:

    "features": [
    "settings": {
        "accountSettings": {
            "enableAccountTeams": true
        "orgPreferenceSettings": {
            "networksEnabled": true
        "nameSettings": {
            "enableMiddleName": true,
            "enableNameSuffix": true

The Problem

Now, we're trying to install these packages in to a Sandbox for testing purposes before we try to go live. The installer runs for about 5 minutes, then gives us the following installation error:

ERROR: Encountered errors installing the package!,Installation errors:

1) Custom Relationship Limit Exceeded, Details: Cannot create new relationship. Each object can have no more than 40 custom relationships, including Master-Detail and Lookup relationships.

The sandbox we're attempting to install to is a copy from production that should have the same "extra custom relationships" settings as production itself. The metadata for this Unlocked Package includes all of the custom relationships we need to successfully deploy the remaining packages.

Is this a current limitation of Unlocked Packages? How is it we're allowed to create packages we cannot install? Do I need to remove one or more fields from my package and/or sandbox to get this to work? All the new features suggests that we should be able to do this without too much difficulty, but the docs are not clear on how to proceed.

The Question

How do we, as a super-sized org, get our sandboxes and scratch orgs to work with our super-sized configuration Unlocked Packages?


Apparently, our org limits were reduced? Here's our current org limits, both in the Sandbox and Production. I'll need to follow up with Support.

Object Limits

  • 1
    @sfdcfox - the PM is asking for you to raise a case, and then update the thread in the chatter group with the case number...can you raise a case, and let me know the number, and I'll post it to the right place – BritishBoyinDC Aug 22 '19 at 21:03
  • 2
    success.salesforce.com/… – BritishBoyinDC Aug 22 '19 at 22:00
  • 2
    @sfdcfox Maybe you have already done this but just to confirm: have you checked under the object limit section of the relevant object(s), to verify that the Custom Relationship Fields limit is really increased above 40 in that sandbox? – Shamina Aug 23 '19 at 13:29
  • 2
    @Shamina Oh. My. Goodness. Looks like the mystery has been solved. Or, at least, one mystery has been solved. I'm not sure why the limits were reduced, but we appear to be over limits. I'm still going to have to see if there's a fix we can apply aside from increasing limits again, but at least I have more info now. – sfdcfox Aug 23 '19 at 14:27
  • 2
    @mlew Confirmed with support: our "extra" relationships were deprovisioned at some point in history, leaving us with 45/40 relationships. My manager has put in a request to have this value increased back to 45 so we can move forward. That said, I appreciate your help and everyone else that has chimed in. – sfdcfox Aug 26 '19 at 16:36

If this is not a new sandbox, have you recently refreshed it?

If not, try and refresh/spawn a new one. Sandboxes do not automatically get production changes, you need to refresh them.

You could also try matching production licenses as below if you can't refresh or spawn a new one:

To match licenses, log in to your sandbox. From Setup, enter Company Information in the Quick Find box, select Company Information, and then click Match Production Licenses. You get an alert when the matching process starts. After all licenses have been matched in sandbox, you get a confirmation email. The confirmation email is sent to the user who initiates the license copy.

But certainly a refresh/new sandbox would be better as this "should" copy your exact production settings.

  • 1
    The question body states "The sandbox we're attempting to install to is a copy from production that should have the same "extra custom relationships" settings as production itself" – David Reed Aug 21 '19 at 14:45
  • Thanks for the idea. I created a new sandbox yesterday, and tried ti again, same results. – sfdcfox Aug 22 '19 at 21:33
  • @DavidReed, yeah, it says that it's an exact copy, but it didn't say when it was refreshed, to someone without much experience the refresh part might not be obvious and it never hurts to validate first. – Nico W Aug 23 '19 at 14:19
  • I just saw this. I'm giving you the mark for this; what happened was Salesforce had reduced our limits in production, such that we actually had over 100% usage of lookups (some odd 140% or so), so Sandboxes were also broken. This was eventually fixed, and the packages install correctly now. – sfdcfox Jun 30 '20 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.