Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Salesforce Production org 1 -

Class AccountUtil
    public String ValidateAccount(String AccountName)
        //validation logic
        return 'validation result';

Salesforce Production Org 2 - has all accounts and data.

I want to call AccountUtil.ValidateAccount('Test Company'); method from Salesforce org 2 in apex is it possible ?

I am interested in options other than SOAP web-service.

share|improve this question
What org do you want the apex code to run against, org1 or org2? – Ryan Guest Dec 26 '12 at 2:31
@RyanGuest is Production to Production – Prafulla Patil Jan 2 '13 at 22:14
up vote 2 down vote accepted

You can Use REST API .All you need is to do an oauth between the two systems and then you can call any exposed API

Refer the above documents for oauth 2.0 implementation.

Follow the above to understand how to create the API.

Sample REST API class

global Class AccountUtil{
public String ValidateAccount(){
    String AccountName =RestContext.request.params.get('accountname');
    //validation logic
    return 'validation result';
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.