Salesforce Apex @future after summer 14
@future @summer'14
@future is an annotation that tells the system to process the data asynchronously, When you specify @future, the method
executes when Salesforce has available resources.
In integrations, There are times when other systems may not respond
immediately when you make a request. And in case of triggers, Apex governors do
not allow callouts as it cannot keep the resources idle until the other systems
respond. That's when you opt for @future.
To make a method in a class execute asynchronously, define
the method with the future annotation. For example:
global class MyFutureClass {
@future
static void myMethod(String a, Integer i) {
static void myMethod(String a, Integer i) {
System.debug('Method called with: ' + a + ' and ' + i);
// Perform
long-running code
}
}
See this link: https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_annotation_future.htm
And there are
limitations which have been really headaches for a developer. Salesforce has
been made aware of it by some ideas and MVPs, so they made some relaxations
in this summer 14.
Some important things that have been changed in Summer 14:
Limitations
|
Before Summer'14
|
After
Summer'14
|
Heap size
|
12MB
|
36 MB
|
CPU timeout
|
60,000 milliseconds
|
180,000 milliseconds
|
Number of SOQL queries
|
200
|
600
|
Number of DML statements
|
150
|
450
|
Number of records that were processed
as a result of DML operations
|
10000
|
20000
|
Happy Coding.
Comments
Post a Comment