Governer Limits

 Governer Limits

 

1. What are Governer limits in Salesforce?

Ans: Salesforce has governer limits to assure the practical usage of resources present in the Force.com platform. To use the code effectively, salesforce establishes some limits, and they are known as Governer Limits.

DescriptionSynchronous LimitAsynchronous Limit
Total number of SOQL queries issued1100200
Total number of records retrieved by SOQL queries50,000
Total number of records retrieved by Database.getQueryLocator10,000
Total number of SOSL queries issued20
Total number of records retrieved by a single SOSL query2,000
Total number of DML statements issued2150
Total number of records processed as a result of DML statementsApproval.process, or database.emptyRecycleBin10,000
Total stack depth for any Apex invocation that recursively fires triggers due to insertupdate, or delete statements316
Total number of callouts (HTTP requests or web services calls) in a transaction100
Maximum cumulative timeout for all callouts (HTTP requests or Web services calls) in a transaction120 seconds
Maximum number of methods with the future annotation allowed per Apex invocation500 in batch and future contexts; 1 in queueable context
Maximum number of Apex jobs added to the queue with System.enqueueJob501
Total number of sendEmail methods allowed10
Total heap size46 MB12 MB
Maximum CPU time on the Salesforce servers510,000 milliseconds60,000 milliseconds
Maximum execution time for each Apex transaction10 minutes
Maximum number of push notification method calls allowed per Apex transaction10
Maximum number of push notifications that can be sent in each push notification method call2,000
Maximum number of EventBus.publish calls for events configured to publish immediately150

2. Object limit in Salesforce?
Ans:
   Saleforce edition                Custom fields per Object             Total Custom Objects
   Group Edition                                       100                                                                      50
   Professional Edition                             100                                                                      50
   Enterprise Edition                                500                                                                      200
   Unlimited Edition                                 500                                                                    2000

  • Active Lookup Filters      : 5
  • Active Validation Rules   : 100
  • Active Workflow Rules   :  50
  • Approval Process            : 500
  • Custom Fields                  : 500
  • Custom Relationship Fields  : 40
  • Rollup Summary Fields   :  25
  • Sharing Rules(Both Owner - and Criteria - based) : 300
  • Sharing Rules(Criteria - based Only) : 50
  • Total Workflow Rules : 500
  • VLOOKUP Functions : 10
  

3. How to get current logged in UserId in Salesforce?
Ans:   In Formula fields use $user.Id.
          In Apex use UserInfo.getUserId().
          In Visualforce Pages use:  {!$user.Id}
          In Lightning use:  $A.get("$SobjectType.CurrentUser.Id");

No comments: