Skip to main content
19 votes
Accepted

Create scratch org with namespace?

In the project configuration file, specify the namespace. { "packageDirectories" : [ { "path": "force-app", "default": true} ], "namespace": "myns", "sfdcLoginUrl" : "https://login....
sfdcfox's user avatar
  • 502k
12 votes
Accepted

Link Namespace error=invalid_client_id&error_description=client%20identifier%20invalid

This is a timing issue. After setting up the Dev Hub playground Packaging Playground and enabling the Dev Hub in the Dev Hub playground ... you may need to wait a few minutes for the credentials ...
cropredy's user avatar
  • 73.3k
11 votes
Accepted

Who has taken "my" Managed package namespace? Can we find out?

There is the possibility of installing the package using Metadata API. Then inspect the company details, package version description or documentation (etc) for meaningful contact information. For ...
Matt and Neil's user avatar
8 votes
Accepted

How To? Namespace and multiple dev orgs

The answer to this is to use Salesforce DX, which will be released any day now. DX allows you to create new dev orgs that all share the same namespace as the packaging org. This makes it a lot easier ...
sfdcfox's user avatar
  • 502k
7 votes
Accepted

How do I update a namespaced Custom Metadata Type record after making a package?

The app needs to be using the full, qualified name of the record. If both the type and the particular record are in NameSpace, you need: cm.fullName = 'NameSpace__type.NameSpace__record'
Avrom Roy-Faderman's user avatar
7 votes
Accepted

Namespace in lightning component

Thats a current limitation of the platform .The Javascript file does not get namespace added unlike visualforce pages for managed package . I wrote a blog post on this . The best way would be to ...
Mohith Shrivastava's user avatar
7 votes
Accepted

Unable to access Apex in namespaced scratch org

Something was wrong with my scratch org. After I recreate it 2 times it worked without adding any namespaces. I didn't delete my question as this might happen others and then the thread is helpful. ...
Robert Sösemann's user avatar
6 votes
Accepted

Best practices to follow to organize classes/pages based on app?

Salesforce has an idea for organizing code. It's eight years in the making, but it is under PM review, so they're at least considering it. Also, once Salesforce DX comes out, we'll have "artifacts", ...
sfdcfox's user avatar
  • 502k
6 votes

Considering for developing code for managed package

Generally speaking the managed package code base does not need to explicitly provide namespace prefixing (for Apex classes, custom objects, custom fields, field sets etc.). The Salesforce runtime ...
Phil W's user avatar
  • 38.2k
6 votes
Accepted

Can we change the namespace case?

You would have to discard the current package and namespace, register a new namespace via a new org, link the namespace to your dev hub and create a new package. Not to mention any code-level or ...
Phil W's user avatar
  • 38.2k
5 votes

Get current namespace in Lightning Aura Component

How about this component.getType().split(':')[0]; If no namespace it will return "c".
Mik's user avatar
  • 51
5 votes

Get current namespace in Lightning Aura Component

I thought this would not work but it seems to in one of my development org with the component bundle version set to 40.0 (so locker should be enabled) console.log(component.getConcreteComponent()....
Eric's user avatar
  • 54.4k
5 votes
Accepted

Can a managed package query and list all the classes installed in a subscriber organization?

If the class you're interested in looking for is global, you can save a query by using Type.forName(namespacePrefix, className). In all other cases, you should be able to at least query for the given ...
sfdcfox's user avatar
  • 502k
5 votes
Accepted

SFDX & How to handle namespace in lwc with a managed package?

Thanks @Anshul Agrawal, you've confirmed what I figured out yesterday. For others facing the same issues, here's what I've discovered: You don't need to include the package namespace in the @import ...
PatMcClellan__c's user avatar
5 votes

Type.forName(..) returns null for Unlocked Package with Spring 20' release

This is part of the critical update documented here https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_apex_publicConstructorsInMgdPackages.htm?edition=&impact= Specifically ...
thegogz's user avatar
  • 368
5 votes
Accepted

How can I include translations in my managed package?

In order to include translations in your managed package, you just need to specify them in the package manifest. This is the same process as adding a custom field, object, class, etc. In order to ...
sfdcfox's user avatar
  • 502k
5 votes
Accepted

ERROR running force:org:create: We don’t recognize this namespace: x. Did you register it in your Dev Hub org?

The documentation specifically says: Sign up for a new Developer Edition org I.e. you are right; you must have an org on which the namespace is defined and the (recommended) way of doing that is to ...
Phil W's user avatar
  • 38.2k
4 votes
Accepted

What namespace to use when developing Lightning components for a managed package?

When using Salesforce DX, you register your namespace with the Dev Hub. From there, you can create Scratch Orgs that use the namespace by using the namespace attribute in your scratch org definition ...
sfdcfox's user avatar
  • 502k
4 votes

Apex: Getting namespace prefix

Can you not try like this without doing any extra efforts? If you know any custom field or custom object of your managed package then the following solution should work. If you have a custom object ...
Naval Sharma's user avatar
  • 1,737
4 votes

Namespace Prefix in JavaScript and Apex within Installed Package

The most straightforward approach to finding an Org's Namespace Prefix in Apex / SOQL is to simply query the Organization object's NamespacePrefix field: Organization org = [ select ...
zachelrath's user avatar
  • 9,593
4 votes
Accepted

Custom Script Eval error when developing a lightning component in an organization with namespace

Its looks like an issue with your library. When you encounter errors related to the external libraries the first place to look for is checking your library against Locker console. As a reference, ...
Hemavantha Rajesh Varma Mudunu's user avatar
4 votes
Accepted

Managed Package: Aura Component and JS Controller and Helper files are not resolving the API names of custom object and custom fields

The "Organizations with a Namespace Prefix" section of Namespace Usage Examples and Reference confirms that you do need to include the namespace. As sfdcfox says, one advantage of using Scratch Orgs ...
Keith C's user avatar
  • 137k
4 votes
Accepted

Why the AuraEnabled method throws an internal error when a namespace is enabled

Turned out the problem is how AuraEnabled handles the namespaces. Currently, it's just impossible to use nested classes in namespaced Aura. This is true for regular (non-LWC) Aura as well, but has a ...
nchursin's user avatar
  • 1,001
4 votes
Accepted

Is it possible to link a namespace frome a developer org to a developer hub

It's important to note that linking a namespace does not imply anything about ownership of packages and package versions that use that namespace. You can link your namespace to an arbitrary number of ...
David Reed's user avatar
  • 93.7k
4 votes
Accepted

Issue with Dependency Package Picklist Value Not Found

What you are trying to do is not supported well by packaging. It is possible, but clumsy, in first-generation packaging, and I don't believe you can make it work with second-generation managed ...
David Reed's user avatar
  • 93.7k
4 votes

Flow in Unlocked Package fails as Formula uses no namespace

Flows do, indeed, need certain elements to include the namespace. I think it's a bug but we live with it by ensuring the namespace prefix is included where required. For us, this includes: Fields ...
Phil W's user avatar
  • 38.2k
4 votes
Accepted

2nd Generation package should be developed in which org?

Could we use Developer Edition org for development or it is just used only for the namespace creation? You can use the Developer Edition org as well to build and deploy code. However, it is not ...
Mohith Shrivastava's user avatar
4 votes
Accepted

Why can't I make my packaged code not namespace-agnostic?

Sadly, several metadata types do require the namespace prefix for various references (common ones are Aura components and Flows, for example). I think you are stuck with either: Suggesting a string ...
Phil W's user avatar
  • 38.2k
3 votes

How do I add a namespace to an existing project?

Lightning components (Same as Managed Package) https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/namespaces_creating.htm Create a namespace for your organization by ...
Eric's user avatar
  • 54.4k
3 votes
Accepted

How to create a custom field outside of the namespace?

No (mostly). There is a bug I found where a non-namespaced field appeared in my developer org, but I can't reliably reproduce it. Any fields you create through normal means will be namespaced. ...
sfdcfox's user avatar
  • 502k

Only top scored, non community-wiki answers of a minimum length are eligible