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
Pranav S SanvatsarkarPranav S Sanvatsarkar 

Link Namespace button is disabled

Hello There,

I am learning to use Salesforce DX. I set up the dev hub and trying to link namespace of my developer edition however, finding that the button itself is disabled The button name is - Link Namespace. Does anyone has went through such issue as well? Please, help me out.

Thanks.
Ben RoedellBen Roedell
I second that.  There's no visible Link Namespace button on my Trial org when using lightning experience and when using the classic experience the Link Namespace button is disabled.

I'm unable to learn/experiment/try/test/verify the instructions described at https://help.salesforce.com/articleView?id=sfdx_dev_reg_namespace.htm&type=0
Siddharth Gupta 16Siddharth Gupta 16
I am also not able to use "Link Namespace" button.

User-added image
Paulie PeñaPaulie Peña
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_reg_namespace.htm also talks about linking namespaces. I don't see a "Link Namespace" button at all in my Namespace Registries app, so I definitely can't click on it. BTW, does anyone know what the benefits are of linking a namespace to a scratch org, since the docs don't say why someone would want to do this?
Andrew WeinsteinAndrew Weinstein
Yeah, same here. Button is nowhere to be found in Lightning and disabled in Classic, with no indication of why.
Paulie PeñaPaulie Peña
I see it now, and the button is enabled. I guess I must have been logged in with the wrong user. Since I didn't find a way to get a "Salesforce Limited Access - Free" user to have Namespace Registry permissions, I had to use the main System Administrator user.
George Stevens 16George Stevens 16
SOLVED
To get the Link Namespaces button to be enabled, I did the following:
  1. In My Domain, added a Domain to the Dev Hub org (e.g. foo-domain.my.salesforce.com)
  2. Waited for the confirmation email
  3. Logged out
  4. Logged in using the domain url (e.g https://foo-domain.my.salesforce.com)
  5. In My Domain, click 'Roll Out to Users'
  6. Logged out
  7. Logged in again (with the domain URL)
The button was now enabled in Namespace Registries.  But, clicking it causes a 'Data Not Available' error:
Data Not Available
The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page. 
Click here to return to the previous page.
(Found some clues from this: https://success.salesforce.com/issues_view?id=a1p3A000000EFcgQAG)

Go to Setup->App Setup->Create->Apps
Click "New Connected App" button and set the following values:
Connected App Name: SalesforceDX Namespace Registry 
Api Name: DEVHUB_<random string>
Enable OAuth Settings - checked
Start URL: https://<your-full-my-domain>/environmenthub/soma-callback.apexp
(e.g. https://foo-domain.my.salesforce.com/environmenthub/soma-callback.apexp)
Selected OAuth Scopes:
Access and manage your data (api)
Access your basic information (id, profile, email, address, phone)
Click Save.  
Message is: Allow from 2-10 minutes for your changes to take effect on the server before using the connected app.
Click Continue and wait up to 10 minutes before trying the Link Namespaces button. It took about 6 minutes for me.

The Link Namespace button should then open up to login.salesforce.com.  Use your login for the dev org you want to link the namespace from.  It will go through the OAuth cycle (verification code, then allow/deny access).  Once the OAuth cycle completes, the linked namespace should be listed in the Namespace Registry for the Dev Hub org.
Andrew WeinsteinAndrew Weinstein
thank you! the only part of that i needed was deploying mydomain to all users. that was enough.
Software AlliesSoftware Allies
Same for me, deploying to all users enabled the button. The button then shows in both classic and lightning experience. 

The button also only shows on the "All Namespace Registries" list view. If you do not roll out the domain to all user, it doesn't show in LE at all, but is disable in Classic until this is done.
elly dan harvey mahinayelly dan harvey mahinay
And then what should i put on callback url?
 
Daniel Morton 15Daniel Morton 15
I had a similar issue with an invalid client id after setting up the domain and then clicking "Link Namespace".  I was trying to set up the connected app as described above. 

In turned out that I didn't need to do that and I just had to wait a few minutes and try again.  I don't think a new connected app is necessary, just a bit of patience after the domain is avaliable and the "Link Namespace" button is avaliable.