April 29, 2019

How to find the Limits in Salesforce Org real quick?

Run the below code in Anonymous window.

Sample Code:

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

Get the debug log to find the limits.


(OR)

Run the below code in Anonymous window.

Sample Code:

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

Get the debug log to find the limits.

No comments:

Post a Comment