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
New-DevNew-Dev 

SOAP/HTTP Callout

Hello,

I am learning Salesforce integration and wanted to know if it's possible to have SOAP or HTTP Callout from a standard page/button?  Per documentation, it mentioned it can be triggered from the Visualforce/button but not sure if it's possible from a standard page?  Thanks in advance!

 
Best Answer chosen by New-Dev
Abdul KhatriAbdul Khatri
Yes, it is possible. Here is one way to achieve that.
  1. Create a class with the Callout Method. You need to define class global and method as webservice as mention below
  2. global class CalloutClass {
    
    	webservice static returnValue CalloutMethod(Id ipParam) {
       		//Your code here whether it is REST or SOAP Call
            // Make you business logic here
       	} 
    
    }
  3. In the Custom Button of the standard page layout, you can call this method like this
  4. {!REQUIRESCRIPT("/soap/ajax/43.0/connection.js")}
    {!REQUIRESCRIPT("/soap/ajax/43.0/apex.js")}
    
    var returnValue = sforce.apex.execute("CalloutClass ","CalloutMethod", {idParam:"value"});
    Let me know if this helped.

All Answers

Raj VakatiRaj Vakati
Yes .. its is possiable from the page 
You need to create a Vf page or button and call the apex class from the controller 


Refer this links 

https://ashishkeshari.com/index.php/2017/02/12/salesforce-apex-callouts-using-soap/


https://www.mstsolutions.com/technical/post-salesforce-data-from-one-org-to-another-org-using-soap-api/

http://writeforce.blogspot.com/2013/02/calling-external-web-services-from_9.html
 
Abdul KhatriAbdul Khatri
Yes, it is possible. Here is one way to achieve that.
  1. Create a class with the Callout Method. You need to define class global and method as webservice as mention below
  2. global class CalloutClass {
    
    	webservice static returnValue CalloutMethod(Id ipParam) {
       		//Your code here whether it is REST or SOAP Call
            // Make you business logic here
       	} 
    
    }
  3. In the Custom Button of the standard page layout, you can call this method like this
  4. {!REQUIRESCRIPT("/soap/ajax/43.0/connection.js")}
    {!REQUIRESCRIPT("/soap/ajax/43.0/apex.js")}
    
    var returnValue = sforce.apex.execute("CalloutClass ","CalloutMethod", {idParam:"value"});
    Let me know if this helped.
This was selected as the best answer