• James Ellis
  • NEWBIE
  • 35 Points
  • Member since 2014


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,

We have a need to create a button that on click will take the current Opportunity data (some fields) and pass it into the apex class (that is a future callout) so it can execute the logic in the class. 

How would i do this?
 
//class that does future callout to some endpoint

class Sample {

            @future(callout=true)
             public sendCallOut() {
                       //some action using the current opportunity
                      HttpRequest req = new HttpRequest();
                      //add the appropriate headers
                      ///put opportunity data in the body of request

                     HTTPResponse resp = new HTTPResponse();
                     //send and process request
             }//end sendCallOut()
}//end Sample

 
  • January 12, 2017
  • Like
  • 0
Hi,

We have a need to create a button that on click will take the current Opportunity data (some fields) and pass it into the apex class (that is a future callout) so it can execute the logic in the class. 

How would i do this?
 
//class that does future callout to some endpoint

class Sample {

            @future(callout=true)
             public sendCallOut() {
                       //some action using the current opportunity
                      HttpRequest req = new HttpRequest();
                      //add the appropriate headers
                      ///put opportunity data in the body of request

                     HTTPResponse resp = new HTTPResponse();
                     //send and process request
             }//end sendCallOut()
}//end Sample

 
  • January 12, 2017
  • Like
  • 0