10

My question is how I can intergrate Salesforce with different FTP servers in real time. I have read some articles about it, but to be absolutely sure I thought it would be a good idea to post a question here.

I want to be able to send and receive data from Salesforce as a csv file to a ftp server. How I'm thinking about doing this is listed below.

Send the data:

Create a apex class which query the necessary data in Salesforce and create a csv file. I guess this is trivial? Then send the file to a web service created in Salesforce, just by calling it in the apex code. Create a web service in Salesforce which receives the data from the apex code. This web service should in some way send the data to the appropriate ftp server. I guess I can simply modify some of the code provided by Salesforce to make this work? The file is sent. Receive the data

This one is a bit trickier. I guess I have to pull the data from the FTP server by using my web service, which then send the file collected to the appropriate apex class. Or, the FTP server could send the data to the SFDC web service, I don't know if this is possible? The web services on the other side that sends the data to the ftp server, could send it directly to the SFDC web service, which then again forward it to the apex class. I guess the web service will use the remote site url to connect to the SFDC web service?

  • Do you want to migrate data from one SFDC org to another? – Mahmood Dec 2 '14 at 11:47
  • Have you tried to do it with Jitterbit Data Loader? – Darko Todorovski Dec 2 '14 at 12:01
  • Yes, later on I want to migrate data from one SFDC org to another, but not for this topic @MahmoodButt. Our client do not want to use Jitterbit Data Loader because they find it expensive. – ttveten Dec 2 '14 at 12:04
12

Through the salesforce service (Apex or others) you cannot directly communicate with an FTP server (either upload or download).

Your best bet would be to use an external application. Jitterbit Data Loader is the go to application for FTP interactions with salesforce.

You could also create your own service outside of the salesforce platform.

  • 2
    Using Jitterbit you can query the data source, extract that to a file on a schedule and use command line to zip it up and upload it to a SFTP site. It is a lot easier than trying to set up the Salesforce.com Dataloader to work via Command Line. – Eric Clay Dec 3 '15 at 20:43
  • How can I create a webservice outside Salesforce to achieve it. In our usecase, we don't have the budget to use any third-party tool like Jitterbit, so I have to achieve it via code only. – Student Sep 11 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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