Salesforce Governor Limits are like rules that ensure the platform runs smoothly for everyone by limiting how many resources you can use in your code. Here’s a simple breakdown:
- SOQL Queries: You can only run 100 queries in a single transaction.
- DML Statements: You can only perform 150 DML operations (like insert or update) in one go.
- SOQL Query Rows: You can retrieve a maximum of 50,000 records in one query.
- Heap Size: You can use up to 6MB of memory in a single transaction for synchronous tasks and 12MB for asynchronous.
- CPU Time: Your code can run for a maximum of 10 seconds.
- DML Rows: You can insert/update up to 10,000 records in one transaction.
- Future Methods: You can only schedule 50 future tasks at once.
- API Calls: There’s a limit of 100,000 API calls per day.
- Batch Apex: Each batch job can handle up to 50 million records but processes them in chunks of 2,000 records at a time.
These limits help ensure that no single user or process overwhelms the system, keeping everything running efficiently.