I can find a map of all String -> Schema.SObjectType
types by invoking Schema.getGlobalDescribe()
.
However, that includes a lot of object types I'm not interested in (like casecomment
, processinstance
or apexlog
)
How can I find only those that are available in the Schema Builder?
Best Answer
In short after taking a deeper looker at this for you, I have to conclude the answer to your question is that you can only be partially successful in emulating the filters used by Schema Builder...
The isCustom method will help with the first obviously, the second two are harder to separate. The following uses the fact that Schema Builder seems to favour objects with Record Types (via getRecordTypeInfos). So I based further filtering on this. Note that this is governed method so some filtering on isCreateable objects was also needed. Thus some accessible (but not createable objects) are eliminated sadly.
Anyway, since I spent some time on this for you, I thought I would share anyway. Hopefully this gives you some thoughts and if nothing else a conclusion you can move forward with some other approach or variation on this on. Enjoy!
Following is the best I think you will achieve to cover Custom vs Standard.
This results in the following, which gets pretty close, but no cigar....