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
Satishakumar AwatiSatishakumar Awati 

How to list the API names of all managed package objects within salesforce organization?

I am trying list all the API Names available in a salesforce organization. I am able to retrieve all the object API names using below code:
 
for ( Schema.SObjectType o : Schema.getGlobalDescribe().values() )
{
    Schema.DescribeSObjectResult objResult = o.getDescribe();
    system.debug( 'Sobject: ' + objResult );
    system.debug( 'Sobject API Name: ' + objResult.getName() );
    system.debug( 'Sobject Label Name: ' + objResult.getLabel() );   
}

But the list does not contain the objects belongs to managed packages and unmanaged packages.

And also I am trying to access managed package objects records via workbench.developerforce.com , I am getting the error as

message: Select COUNT(id) FROM CustomObject__c ^ ERROR at Row:1:Column:23 sObject type 'CustomObject__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names. errorCode: INVALID_TYPE
NagendraNagendra (Salesforce Developers) 
Hi Satish,

From what I have read you can get the Sobject Describe of a managed package object but may not be able to see it in Global Describe, do you have a user license to use the package? 

Thanks,
Nagendra
Ashish Narang 14Ashish Narang 14
Try something like

select sobjecttype from ObjectPermissions where parent.NamespacePrefix='ManagedPackageName'

Thanks,
Ashish