Salesforce常见的限制Limitations总结
20. 【List View展示的最大列数为15个】:
19. 【Recycle Bin最多保存删除的数据15天】:remain 15 days
18. 【1个Custom Report Type最多添加4个相关对象】:最多3个子对象
17. 【Home Page上最多显示3个Dashboard Snapshots】:Salesforce Report & Dashboard进阶篇 - 原理浅析
16. 【Import Wizards与Data Loader比较】:When to Use Data Loader
1. Import Wizard -> import up to 5w records;
2. Data Loader -> up to 500w(5 million) records;
3. work with a Salesforce partner or visit the AppExchange for a suitable partner product -> for more than 500w records.
15. 【database.query与database.getQueryLocator】:
database.query in Salesforce: dynamic SOQL query. You can build up a string and then use that as a query string at run time in the database.query statement to make a SOQL call that is determined at run time. In Batch Apex, if you use Database.query(), it supports 50,000 records only.
database.getQueryLocator in Salesforce returns a Query Locator that runs your selected SOQL query returning list that can be iterated over in batch apex or used for displaying large sets in VF (allowing things such as pagination). In Batch Apex, if you use Database.getQueryLocator(), it supports upto 50 million records.
14. 【字段集Field Set Limitation: The total number of spans in the Field Set can't exceed 25】
13. 【child-to-parent soql最多5级查询】:
Exp: Contact.Account.Owner.FirstName(5 levels).
12. 【parent-to-child soql最多只能嵌套1级子查询】
11. 【You can add up to 300 fields per custom setting】
10. 【调试日志记录最大250M,超出时需要手动删除】
9. 【25 ExternalIDs are allowed per object】:Maximum number of External IDs per object or entity
8. 【The maximum size of email attachment is 3 MB when using attach file in a custom email】:
Attach a file to an email template | Send Emails With Attachment in code
7. 【Apex Limits】:
Salesforce Governor Limits:
As you aware that, Salesforce is multitenant platform. Multitenant is a software architecture in which a single instance of software runs on a server and serves multiple user groups. Group of users who share a common access with specific privileges to the software instance.
Governor execution limits ensure the efficient use of resources on the Force.com multitenant platform. Because Apex runs in a multitenant environment, the Apex runtime engine strictly enforces limits to ensure that runaway Apex code or processes don’t monopolize shared resources. If some Apex code ever exceeds a limit, the associated governor issues a runtime exception that cannot be handled.
The Apex limits, or governors, track and enforce the statistics outlined in the following tables and sections.
- Per-Transaction Apex Limits
- Per-Transaction Certified Managed Package Limits
- Force.com Platform Apex Limits
- Static Apex Limits
- Size-Specific Apex Limits
- Miscellaneous Apex Limits
In this blog, I have added few of the Governer Limits mentioned below:
1. Total number of SOQL queries issued:
- Synchronous Limit = 100
- Asynchronous Limit = 200
2. Total number of records retrieved by SOQL queries : 50,000
3. Total number of records retrieved by Database.getQueryLocator : 10,000
4. Total number of SOSL queries issued : 20
5. Total number of records retrieved by a single SOSL query : 2,000
6. Total number of DML statements issued : 150
7. Total number of callouts : 100 (include Web Service and HTTP Request calls in a transaction)
8. Maximum timeout for all callouts : 120 seconds or 2 minutes (include Web Service and HTTP Request calls in a transaction)
9. Maximum number of @future annotation methods allowed : 50
10. Maximum number of Apex jobs added to the queue with System.enqueueJob : 50
11. Total number of sendEmail methods allowed : 10
12. Total heap size : 6 MB or 12 MB
13. Maximum execution time for each Apex transaction : 600 seconds or 10 minutes
14. Maximum number of push notification method calls allowed per Apex transaction : 10
15. Maximum number of push notifications that can be sent in each push notification method call : 2,000
16. Email services heap size is 36 MB.
17. The maximum number of asynchronous Apex method executions per a 24-hour period : 250,000 or the number of user licenses in your organization multiplied by 200, whichever is greater.
18. Maximum number of Apex classes scheduled concurrently : 100
19. Maximum number of batch Apex jobs in the Apex flex queue that are in Holding status : 100
20. Maximum number of batch Apex jobs queued or active concurrently : 5
21. Event Reports : The maximum number of records that an event report returns for a user who is not a system administrator is 20,000; for system administrators, 100,000.
22. Inbound Email Services: Maximum Number of Email Messages Processed : Number of user licenses multiplied by 1,000; maximum 1,000,000
23. Inbound Email Services: Maximum Size of Email Message : 10 MB
There are some Size-Specific Apex Limits. Check below:
1. Maximum number of characters for a class : 1 million
2. Maximum number of characters for a trigger : 1 million
3. Maximum amount of code used by all Apex code in an organization : 3 MB
4. Method size limit : 65,535 bytecode instructions in compiled form
6. 【up to 10 Apex sharing reasons per custom object】Salesforce Apex Sharing Reason
Note: Sharing reason just exist in Custom Object not in Std Object.
5. 【Multi-Picklist的可见行不能超过10个】
4. 【字段历史跟踪Field History Track的最大个数为20】
3. 【Per object最多2个Master-detail field】
2. 【Per object最多25个Lookup field】
1. 【Picklist值不能超过1000】