Hey Guys,
An interesting stuff we could expect in near future from Salesforce is :
Future Methods with Higher Limits (Pilot)
If you are using @future now , you are well aware of the limitations there. Some times we think about if we had a option to increase certain limits. Here is the good news for you.
One of the following limits can be doubled or tripled for each future method.
- Heap size
- CPU timeout
- Number of SOQL queries
- Number of DML statements issued
- Number of records that were processed as a result of DML operations, Aprroval.process, or Database.emptyRecycleBin
When we are declaring a method as
@future(limits=’2x|3x***limitName***’)
Sample code:
@future(limits=’2xHeap‘)
public static void myMethod() {
// Your code here
}
Contents from Salesforce page:
The following limit modifiers are supported. The string value passed to the limits parameter inside the annotation is case-insensitive.
Modifier | Description |
---|---|
@future(limits=’2xHeap’) | Heap size limit is doubled (24 MB). |
@future(limits=’3xHeap’) | Heap size limit is tripled (36 MB). |
@future(limits=’2xCPU’) | CPU timeout is doubled (120,000 milliseconds). |
@future(limits=’3xCPU’) | CPU timeout is tripled (180,000 milliseconds). |
@future(limits=’2xSOQL’) | Number of SOQL queries limit is doubled (400). |
@future(limits=’3xSOQL’) | Number of SOQL queries limit is tripled (600). |
@future(limits=’2xDML’) | Number of DML statements limit is doubled (300). |
@future(limits=’3xDML’) | Number of DML statements limit is tripled (450). |
@future(limits=’2xDMLRows’)1 | Number of records that were processed as a result of DML operations is doubled (20,000). |
@future(limits=’3xDMLRows’)1 | Number of records that were processed as a result of DML operations is tripled (30,000). |
1 Includes Aprroval.process and Database.emptyRecycleBin operations.
Keep reading and sharing..
Reference : Salesforce Blog
Leave a Reply