Skip to main content

Posts

Showing posts with the label All Objects

Object/Action name present in Org with Queryable/Retrieveable/Searchable and many more Status in Query

We always want to know what are the objects present in salesforce so we can utilize any existing if needed or to understand the structure more. Here are few ways which help you to do that. Basic Code to get all object without any query: Schema.DescribeSObjectResult objResult = o.getDescribe();             String obj = objResult.getName();                 System.Debug(objResult.getName()); Basic code to get Object record count, don't run for all object you might get exception of 101 SOQL. Try to run this in a loop of first 100 then 100-200 and more based on need. {             Schema.DescribeSObjectResult objResult = o.getDescribe();             String obj = objResult.getName();             Integer count = 0;             q = 'SELECT Count() FROM ' + obj;             try{                 count = Database.countQuery(q);             }catch(Exception e){                 continue;             }             mapdata.put(objResult.getName(),count);             System.Debug(objResult

Translate