function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
scott_devscott_dev 

Link a Namespace to a Dev Hub Org

Hopefully this is an easy answer for someone. I'm reading through the following documentation (https://help.salesforce.com/articleView?id=sfdx_dev_reg_namespace.htm&type=0) and I need to understand the context of the following:
  • Developer Edition org
  • Dev Hub org
The first line reads "To use a namespace with a scratch org, you must link the Developer Edition org where the namespace is registered to a Dev Hub org."

I need to use a namespace with my scratch org. We already have a Dev Hub enabled in our production org with a custom namespace. Is the "Developer Edition org where the namespace is registered" our production Dev Hub org? Or is that talking about my scratch org? Or some other org?

The reason I'm asking this question is because I had to create a new Dev Hub org for Summer18 preview, and I've created a scratch org from it, but I can't push my code base to the scratch org because the namespace is not recognized. So I'm thinking I need to link our namespace for my Summer18 Dev Hub org by clicking on "Link Namespace" button and login to our production Dev Hub org? And if that works, finally I will need to spin up a new scratch org based on Summer18 Dev Hub, that should then know about our namespace?

I've been working on this for two full days now, an help would be much appreciated. Thanks!
NagendraNagendra (Salesforce Developers) 
Hi Scott,

Sorry for this issue you are encountering.

What you are thinking is correct.

You must link the developer edition org where the namespace is registered.

But as you said that you have to create a dev hub org with summer18 preview for creating a scratch org then the namespace cant be recognized. You are on right track, first link your namespace for summer18 dev hub org then create a new scratch org then use it accordingly.

Hope you might not have any issues further.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra
scott_devscott_dev
Thank you for the reply Nagendra. I logged into my Summer18 Dev Hub org, and went to Namespace Registries, clicked on "Link Namespace" and then provided administrator credentials to our production Dev Hub org. I then receive the following error:

User-added image
I assume I'm receiving this error message because the org I'm logging into is not a Developer Edition org? It does have a registered namespace already.  I guess I'm still confused on how this namespace linking should work. The Summer18 Dev Hub does not currently have a namespace. I want it to use the namespace that our production Dev Hub org is using, so that once I create a scratch org and make some changes, that I can commit code that is using the correct namespace. What am I missing?