Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. Integer count = 0;
  2. map<String, Schema.SObjectType> GlobalMap = Schema.getGlobalDescribe();
  3.  
  4. {
  5. for (Schema.SObjectType Obj : GlobalMap.values()) {
  6. Schema.DescribeSObjectResult ObjDesc = Obj.getDescribe();
  7. if(ObjDesc.iscustom()){
  8. count ++;
  9. system.debug('Object Name: ' + ObjDesc.getName());
  10. }
  11. }
  12. System.debug('Custom Object '+ count );
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement