You need to sign in to do that
Don't have an account?
Viraj
Want get the namespace of the Salesforce org
Hi,
Is there a way to get the namespace prefix of a Salesforce organization using Apex code ?
I have developed an AppExchange application. This application need to know the namespace of the Salesforce organization to create a record.
Thanks
Viraj
What record are you creating? As far I as know, namespaces are only used for custom objects and fields in managed packages.
I am creating a Visualforce page and some static resources. To use the static resources in the Visualforce page I must know the namespace of the org. Therefore I must know namespace of the org before creating the Visualforce page.
Viraj
Sorry, I'm confused now. Originally you needed to create a record. So, you need to access static resources in a company's org from a VF page in your packaged AppExchange app? I thought namespaces only came into play when accessing components in a managed package.
The namespace prefix is added to Apex classes and triggers, Visualforce components and pages, brand templates, folders, s-controls, static resources, web links, and custom report types if they are included in a managed package. However, if your profile does not have customize application permissions, the namespace prefix field is not displayed for brand templates, folders, and custom report types.
OK.
I have another question.
Does Salesforce allow to put namespace to production organizations ?
Viraj
Please create a new thread for the new question.
string namespace = [SELECT NamespacePrefix FROM Organization].NamespacePrefix;