+ 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.