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
Shiva RajendranShiva Rajendran 

Get account records another salesforce org to a custom vf page

I have two orgs org1 and org2 . i want to create a vf page and controller in org1 which will display all the accounts present in org2 , let me know how it is possible?

Thanks and Regards,
Shiva RV
Best Answer chosen by Shiva Rajendran
Vivian Charlie 1208Vivian Charlie 1208

Hi Shiva,


We need to keep 1 thing in mind here that the 2 org's cannot share detail without setting up any integration. Inorder to achieve this you will need to perform the following steps

  • In Source org create a webservice class and write your query for returning data
  • In Source org create a VF page and set the controller as the above class
  • In Source org create a site and add the VF to the site
  • In Destination org make an API call to the Source org (endpoint must be the site url) from the action attribute of apex:page
  • Parse the json response into a wrapper or same object incase all fields are same
  • Use this list to display on your page

Let me know if this helps. I have implemented this and also have the code for it. I'd like yoo to try first in case you have any doubts let me now so that I can assist you.


Thanks
Vivian

All Answers

Vivian Charlie 1208Vivian Charlie 1208

Hi Shiva,


We need to keep 1 thing in mind here that the 2 org's cannot share detail without setting up any integration. Inorder to achieve this you will need to perform the following steps

  • In Source org create a webservice class and write your query for returning data
  • In Source org create a VF page and set the controller as the above class
  • In Source org create a site and add the VF to the site
  • In Destination org make an API call to the Source org (endpoint must be the site url) from the action attribute of apex:page
  • Parse the json response into a wrapper or same object incase all fields are same
  • Use this list to display on your page

Let me know if this helps. I have implemented this and also have the code for it. I'd like yoo to try first in case you have any doubts let me now so that I can assist you.


Thanks
Vivian

This was selected as the best answer
Vivian Charlie 1208Vivian Charlie 1208
Hi Shiva,

Just following up if you were able to resolve the issue. If Yes, please feel free to mark this post as closed so that others can also benefit from it.
 
Thanks
Vivian
Shiva RajendranShiva Rajendran
Hi Vivian ,
Actually we could fetch the standard object records without exposing the web service . I dono will the same work for custom object as well.If you have any idea regarding that please do share it with me

 Thanks and Regards,
Shiva RV