+ Start a Discussion
super developersuper developer 

How can i Invoke remote webservice from apex class/trigger

Hi Guys,


there are 2 sfdc accounts.SFDC1,SFDC2(developer accounts).


I want call webservice of SFDC1 in SFDC2 apex class/trigger. 


Please help me.






I don't think you call a Salesforce web service from another Salesforce org, I reckon you'll need to hit some third party to achieve this.


If you are looking to pass record data between two salesforce orgs, take a look at salesforce to salesforce.

super developersuper developer

Hi bob,


Thanks for your reply.


But my problem is I want move data of one standard object SFDC1 to custom object SFDC2 baed on event(insert,update).


Is there any way to achieve this.


I think by using salesforce to salesforce we need to move data only standard object to standard object. 


I am going to do this with generate from wsdl it will generate apex code. But i'm stucked with how to call this class.


Salesforce to Salesforce does allow transfer of custom objects.  I've not used it programmatically though, so I don't know how easy it is to transfer from a trigger.

super developersuper developer

Hi Bob,


I Imported wsdl file of sfdc2  into Sfdc1 and it is generated apex code, but i am unable to use it.


Do you any idea to solve this problem.


As I said in the first post - I don't think you can call the web services on one salesforce instance from another.