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
VirajViraj 

Visualforce and namespace prefix

Hi,

I have developed an application which has visualforce pages, apex classes and some custom fields and custom tables.
Now I want to introduce a Namespace prefix for my organization and create a managed package and upload it to Salesforce.

I would appreciate if could get answers to following questions.
1. Do I have to put the namespace prefix for custom fields, tables used in the visualforce, apex classes ?
2. If I do not put namespace prefix for custom fields, tables in the visualforce, apex classes will my managed package work properly when it is installed in another Salesforce organisation.


Thanks
Viraj


SuzanyuSuzanyu
You do not need to put namespace prefix in your code even trigger. Only thing you need to check is the dynamic apex. If you use dynamic apex(you can learn about what is dynamic apex in apex_developer_guide) , you need to add prefix.
prashantprashant
1. Do I have to put the namespace prefix for custom fields, tables used in the visualforce, apex classes ?
Ans: Yes, You have to put the namespace prefix for custom fields, tables used in the visualforce, apex classes .
 
2. If I do not put namespace prefix for custom fields, tables in the visualforce, apex classes will my managed package work properly when it is installed in another Salesforce organisation.
 
Ans:No,your  managed packagewill not work.
SuzanyuSuzanyu

I don't know why your package not work.

Because mine is released-managed package with custom objects, custom fields, apex class, visual force page and triggers, I installed that to several instances. works fine.

only put prefix into dynamic apex code.

you need to check developer guide I think.

 

good luck

 

prageethprageeth
Can you send us a link to a good reference for this point. I looked at the developers guide. But couldn't find a direct answer.