How to find the Limits in Salesforce Org real quick?

How to find the Limits in Salesforce Org real quick?

Run the below code in Anonymous window.

Sample Code:

for ( OrgLimit o : OrgLimits.getAll() ) {  
      
    system.debug( o.getName() + ' - ' + o.getValue() + ' - ' + o.getLimit() );  
      
}  

Get the debug log to find the limits.

(OR)

Run the below code in Anonymous window.

Sample Code:

Http h = new Http();  
HttpRequest req = new HttpRequest();  
req.setEndpoint( Url.getOrgDomainUrl().toExternalForm() + '/services/data/v44.0/limits' );  
req.setMethod('GET');  
req.setHeader( 'Authorization', 'Bearer ' + UserInfo.getSessionId() );  
HttpResponse res = h.send(req);  
system.debug( 'Limits are ' + res.getBody() );  

Get the debug log to find the limits.

Reference Link:

https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_OrgLimits.htm

Leave a Reply