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
SanalSanal 

Can we provide custum buttons that can talk to a webservice?

Hi,

somebody please help me on the following. Is it possible to have custom buttons in for the objects/tabs that can communicate with the webservice which is deployed in another server? If yes, will you redirect to me to some documents regarding this. I'm unable to find them :(

Thanks in Advance,
Sanal
Ron WildRon Wild
It sounds like you might be talking about making a cross-domain request, which isn't supported in most of the popular browsers.  

However, if you were to create an apex module that called the third-party web service for you, you could call it using the s-control tied to your button.  This would be a call to a server-side script on the same domain (salesforce) and would get you around the cross-domain issue.

Check the Apex cookbook for examples on calling Apex methods from an S-control.

Then look at the docs for examples on importing a WSDL (in this case, from your third party web service) to autogenerate Apex code for calling the web service.

HTH

SanalSanal
Thanks Ron. Let me try your suggestion. I will update the status back.

- Sanal