Activity Forums Salesforce® Discussions How can be a future annotation be used in a trigger? Is that trigger works in synchronous manner or asynchronous manner?

  • How can be a future annotation be used in a trigger? Is that trigger works in synchronous manner or asynchronous manner?

    Posted by PRANAV on August 23, 2016 at 1:31 pm

    Hi All,

    How can be a future annotation be used in a trigger? Is that trigger works in a synchronous manner or asynchronous manner?

    Thanks

    Surbhi replied 7 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Surbhi

    Member
    August 30, 2016 at 1:45 pm

    Hi Pranav,

    You just have to add @future in the trigger. This annotation is executed asynchronously when Salesforce has available resources. It is mainly used if in case, there are some calculation on an object, which is to be done after insert but no matter with the user operation. Then this can be done asynchronously with this future annotation. It can also be used to calls to external web services.

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos