function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sd2008sd2008 

how many @future annotation is needed for one class?

I have a global class, which has two Methods, and each performs a different out call function,

should each method has a @future annotation?

 

for example,

 

global class PerformOutcall {

 

     @future (callout=true)

       public static void OutCallRun1() {              WS.ServiceSoap dns =

new WS.ServiceSoap();

              dns.Webservice1();

     }

 

     @future (callout=true)

      public static void OutCallRun2() {              WS.ServiceSoap dns =

new WS.ServiceSoap();

              dns.Webservice2();

     }

 

 

}

Best Answer chosen by Admin (Salesforce Developers) 
cheenathcheenath

Yes, each method needs @future annotation.