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
bhbh 

Namespace considerations

Hi.

 

Once I have a namespace for my code, is that namespace tied to that particular instance?

 

Background:
I am trying to establish a good strategy about creating an AppExchange App.

 

I have part of the code on an existing production org (Call it OrgA). other parts of the code exist in another developer-org (Call it OrgB).

 

  1. I'm afraid that if I copy all the code to OrgB, get a namespace, and then deploy back to OrgA - I'll get duplicate fields. Am I right to worry?
  2. I can make a sandbox for OrgA, and put all my code there. In that case, can I get a namespace for my code there? Am I then doomed to develop in the sandbox (which is subject to limits etc.?)

Your help would be much appreciated

aalbertaalbert

1. you can only create a managed package (ie define a namespace) in a Developer Edition org. You can't do that in a Sandbox. 

2. if you have a field called 'Type__c' defined in OrgA, then create a managed package in a Developer Edition org that also has a field called 'Type__c', then install the package back into OrgA, you will have 2 fields called 'Type__c'. One field will have no namespace. The other will be prefixed with the namespace. 

 

bhbh

Hi Aalbert,


You helped clarify my question. thank you.

 

Question: What would you recommend I do in my situation, where I have code in a production instance that I want to package.

 

Problem:

If I copy the code do a dev org, package it, and install again, the duplicate fields will be empty and the existing, unpackaged fields, will not be managed.

 

Thanks,

 

Ben

aalbertaalbert

It depends. 

 

1. Leave it as is. Don't install the managed package into your org since you already have the right configuration. 

2. But that option means you likely have to to support two codebases (one unmanaged, one managed). So if you want to switch from the unmanaged to managed, install the managed package and migrate the data from the unmanaged objects and fields to the managed objects and fields. You also will want to rebuild reports to reference the managed schema. Same for workflow, approvals, etc. Make sure you basically delete/remove all the unmanaged components to be replaced by the managed - in addition to migrating the data.