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
VenkatVenkat 

Getting Custom Objects list without managed package objects.

Hi,

Custom Objects (Unlimited Edition)  - 2,000
Note from Salesforce - (The custom objects contained in a managed package publicly posted on the AppExchange don't count against the limits for your Salesforce Edition).
//It will get list of all custom objects.
Map <String, Schema.SObjectType> allObjects = Schema.getGlobalDescribe();                
Map<String, Schema.DescribeSObjectResult> allObjectsNames = new Map<String, Schema.DescribeSObjectResult>();       
for(Schema.SObjectType objType : allObjects.values())        
{
                        Schema.DescribeSObjectResult objectResult = objType.getDescribe();                                    	        
                           if(objectResult.isCustom() && !objectResult.isCustomSetting() && !objectResult.getName().endsWith('__c_hd'))
	            {
                                allObjectsNames.put(objectResult.getName(), objectResult); 
	            }
}
I am writing the above code for getting all custom objects.

It is getting all custom objects including managed package objects. How can I avoid(filter) managed package objects.

Thanks
Venkat.
RamuRamu (Salesforce Developers) 
Came across these two posts which might help you.

http://developer.force.com/cookbook/recipe/retrieve-a-list-of-objects-using-apex

http://salesforce.stackexchange.com/questions/13852/how-to-retrieve-layouts-of-customs-objects-belonging-to-a-managed-package