This will work for managed package because "MyClass' will already have a namespace (our namespace). So that query will always return our namespace and not the org namespace where the app is installed.
Does the Organization NamespacePrefix field solve the issue of the above solution not working in managed packages? For example, if I had the following code in a managed package that is installed on an org other than the package org, will this SOQL return null since I am outside my package org or is it smart enought (context aware) to figure out that the code is running in the context of my managed packge and get the correct namespace prefix?
string np = [SELECT NamespacePrefix FROM Organization].NamespacePrefix;
Hi All,
I have solved the issue.
Please see the following solution:
Regards,
Dipak
All Answers
Hi All,
I have solved the issue.
Please see the following solution:
Regards,
Dipak
@Daniel, I have upvoted your answer.
in query editor run this query
[select id,DeveloperName,NamespacePrefix from CustomObject];
yoou should check box tooling api, beside the execute button in developer console