in Technology by
What is Future annotation(@future) in Salesforce?

1 Answer

0 votes
by
  • Future annotations are used to specify methods that are executed asynchronously.
  • Methods having future annotation must be static methods and can only return a void type. The arguments specified must be primitive data types or arrays of primitive data types or collections of primitive data types. These methods cannot take sObjects or objects as parameters.
  • When you specify a method with @future annotation, it will be executed only when Salesforce has available resources.
  • For example, you can use future annotation while making an asynchronous web service callout to an external service. Whereas without the usage of future annotation, web service callout will be created from the same thread which is executing the Apex code, and no additional processing will take place until that callout is complete (synchronous processing).

Syntax:

global class class_name
{
    @future
    Static void methodname(parameters)
    {
        //body of the method
    }
}`

Related questions

0 votes
    What is the use of “@future” annotation?...
asked Nov 11, 2020 in Technology by JackTerrance
0 votes
    What do you think about the future of blockchain?...
asked Dec 26, 2020 in Technology by JackTerrance
0 votes
    What is the way to help establish a future state portfolio canvas?...
asked Nov 28, 2020 in Technology by JackTerrance
0 votes
    What is one way to help establish a future state portfolio canvas?...
asked Nov 28, 2020 in Technology by JackTerrance
0 votes
    Voting reflects the power of democracy. Describe the role of a voter in shaping the future of a democratic nation Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    1.Voting reflects the power of democracy. Describe the role of a voter in shaping the future of a democratic nation. Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    I'm working on a program that displays a list from an SQFlite table. The future for the snapshot ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 30, 2022 in Education by JackTerrance
0 votes
    I have a Time series data for almost 5 years. Using this data I want to forecast next 2 years. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    Which of these classes can schedule task for execution in future? (a) Thread (b) Timer (c) System (d) ... More Utility Classes of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    __________ modifies geom/stat aesthetic defaults for future plots. (a) translate_qplot_base (b) translate_qplot_gpl (c ... Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me how will Machine Learning impact the future of jobs? Select the correct answer from above options...
asked Jan 11, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me how will Predictive Analytics change the future? Select the correct answer from above options...
asked Jan 10, 2022 in Education by JackTerrance
0 votes
    Executive su Which part of the 5 step Strategic Design process keeps the User at the Center Future ... Disruptive Insights Submit Select the correct answer from above options...
asked Dec 6, 2021 in Education by JackTerrance
0 votes
    Executive su Which part of the 5 step Strategic Design process keeps the User at the Center Future ... Disruptive Insights Submit Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    Executive su Which part of the 5 step Strategic Design process keeps the User at the Center Future ... Disruptive Insights Submit Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
...