+ Start a Discussion
Sourav PSourav P 

what is Namespace in apex?

Hi
If anyone can describe me the definition of " Namespace" in simple terms to understand. i tried to refer the apex developer guide but not able to understand properly, Thanks

User-added image
Best Answer chosen by Sourav P
Deepali KulshresthaDeepali Kulshrestha
Hi Sourav,

As per your question, a namespace can be said to be the prefixes used to differentiate custom object and field names in 
managed Force.com AppExchange packages.

Please refer to these links it may be helpful to you:
https://developer.salesforce.com/forums/?id=906F000000091hwIAA
https://developer.salesforce.com/blogs/developer-relations/2012/08/default-namespaces-in-apex.html

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha 

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Sourav,


Namespace prefixes are used in managed Force.com AppExchange packages to differentiate custom object and field names from those in use by other organizations.

After registering a unique namespace object or field API name will look like
namespace_prefix__object_or_field_name__c

Example:
your field name - test__c
and your Namespace name is "app" then resultant field name will be "app__test__c".

It is a very useful feature so that the API name of Manage package should not conflict with native fields API Name.

Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra
Deepali KulshresthaDeepali Kulshrestha
Hi Sourav,

As per your question, a namespace can be said to be the prefixes used to differentiate custom object and field names in 
managed Force.com AppExchange packages.

Please refer to these links it may be helpful to you:
https://developer.salesforce.com/forums/?id=906F000000091hwIAA
https://developer.salesforce.com/blogs/developer-relations/2012/08/default-namespaces-in-apex.html

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha 
This was selected as the best answer
Sourav PSourav P
Hi Nagendra, Thanks

If its been used in managed apps, what is teh use of standard namespace like System, Schema etc ?
Sourav PSourav P
Dear both, thanks. i got it now