Contents
Can we call a method from future method?
Limitations of Future method: You cannot call one future method from another method. Can have only primate as parameters. Order of Invocation is not respected. Cannot invoke future method from another future method.
How do I call a future method in Salesforce?
Future method syntax
- Use @future annotation before the method declaration.
- Future methods must be static methods, and can only return a void type.
- The specified parameters must be primitive data types, arrays of primitive data types, or collections of primitive data types.
How to call future from a trigger in Salesforce?
1. create a batch apex class. See documentation here: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm You’ll need to create a start, execute and a finish method. 2. the constructor of the batch should have a Set argument so you can send the list of order numbers.
What does it mean to bulkify Apex code?
Bulkifying Apex code refers to the concept of making sure the code properly handles more than one record at a time. An individual Apex request gets a maximum of 100 SOQL queries before exceeding that governor limit. So if this trigger is invoked by a batch of more than 100 Account records, the governor limit will throw a runtime exception
What happens if you have multiple triggers in apex?
If you develop multiple Triggers for a single object, you have no way of controlling the order of execution if those Triggers can run in the same contexts If you write methods in your Triggers, those can’t be exposed for test purposes. You also can’t expose logic to be re-used anywhere else in your org.
Can a trigger be exposed for test purposes?
If you write methods in your Triggers, those can’t be exposed for test purposes. You also can’t expose logic to be re-used anywhere else in your org.