Skip to main content

Connect #ZOOM with #Salesforce using #Zapier | Salesforce Tutorials

How to Automatically download csv file from SFTP and upload it to Salesforce using CLI Dataloader and Batch ?

How to Automatically download csv file from SFTP and upload it to Salesforce using CLI Dataloader and Batch ?

OR

How to upload csv file to Salesforce Automatically using batch and window scheduler ?




So basically the requirement was to automatically download the file from a FTP/SFTP and upload the file in Salesforce Leads.

To achieve this functionality in short we will create a batch to download the file from FTP/SFTP and save it in our local machine. And then upload it to salesforce Leads using CLI Data Loader.

Please follow below steps : 


STEP : A

  1. Download & Install WinSCP on a window machine.
  2. Connect the FTP/SFTP using credentials.
  3. Go to session → Generate session URL/code.
  4. Check only User Name, Password & Initial directory in the case of FTP.
  5. In the case of SFTP check SSH host key checkbox also.
  6. Copy the generated url.
  7. Create a txt file using following code below : 



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Connect

Open URL COPIED FROM STEP 5 

# Change remote directory

cd /

# Download file to the local directory c:\

get fileName.csv c:\TestFolder\

# Disconnect

Close






  1. Save the txt file. My file name is example.txt
  2. Open CMD.
  3. Copy and paste following command :
1
"C:\Program Files (x86)\WinSCP\WinSCP.com" /ini=nul /script=C:\TestFolder\example.txt

  1. Hit enter.
  2. The file will be copied from your FTP/SFTP to your window machine.


STEP : B
  1. First of all, make sure you have the Admin rights on the machine.
  2. Then, download the data loader setup file on the machine by going into Salesforce environment Setup –> Data Management –> Data Loader. Choose the option “Download Data Loader for Windows“. It will download the latest version of data loader setup file. Install it by following the setup wizard.
  3. Also, you need to have the required version of JRE (Java Run Time Environment). 
    1. Download the latest JRE version from Oracle site downloads page.
    2. Install the downloaded JRE file.
    3. Please follow steps 1 to 5 from this link below : https://developer.salesforce.com/docs/atlas.en-us.dataLoader.meta/dataLoader/command_line_intro.htm

Step : C
  1. Create batch file of commands.
  2. Schedule the task in window scheduler, follow the steps here https://www.thewindowsclub.com/how-to-schedule-batch-file-run-automatically-windows-7

Schedule the batch classes and you are good to go.

Notes :
If you have any question please leave a comment below.
If you would like to add something to this post please leave a comment below.
Share this blog with your friends if you find it helpful somehow !

Thanks
Keep Coding šŸ˜Š

Comments

Popular posts from this blog

How to send WhatsApp from Lightning Component Salesforce ?

Send WhatsApp from Lightning Component SalesforceHi folks, in this article I will explain how you can send WhatsApp from Lightning Component using https://wa.me/
In this example I will create a Quick Action button on Contact which will be connected with my Lightning Component.
Please follow the steps below : 
Step 1 : Create a Lightning Component & Apex as shown below
WhatsApp.cmp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30<aura:componentcontroller="Vlog_whatsappCTRL"implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"access="global"><aura:attributename="recordId"type="String"/><aura:attributename="con"type="Contact"/><aura:attributename="msg"type="String"/><aura:handlername="init"action…

Send WhatsApp and Save Chat using Lightning Component Salesforce | Salesforce Tutorials

Hello folks,
In this article you will learn to send WhatsApp and Save the Chat using Lightning Component Salesforce. 
Prerequisite : 
Create a custom object WhatsApp__c
Create custom fields as shown below : 


Please follow the code below : 

WhatsAppComponent 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30<aura:componentcontroller="Vlog_whatsappCTRL"implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"access="global"><aura:attributename="recordId"type="String"/><aura:attributename="con"type="Contact"/><aura:attributename="msg"type="String"/><aura:handlername="init"action="{!c.doInit}"value="{!this}"/><articleclass="slds-card"><divclass="slds-card__header…

Get Parent Id when overriding standard actions with a Lightning Component in salesforce1 app

How to Get Parent Id when overriding standard actions with a Lightning Component in salesforce1 app ?
In this blog I will explain how you can get Parent Id when overriding standard actions with a lightning component.
For example I have changed my Opportunity New button action with a custom Lightning Component. 
Let's create a new account and from the related tab try creating the new Opportunity. Have you noticed any change in URL ?
Let me share the URL with you :  _________________________________________________________________________ https://kapilbatra1-dev-ed.lightning.force.com/lightning/o/Opportunity/new?recordTypeId=0127F000000htlpQAA&additionalParams=accid%3D0017F00002S6g9H%26&inContextOfRef=1.eyJ0eXBlIjoic3RhbmRhcmRfX3JlY29yZFBhZ2UiLCJhdHRyaWJ1dGVzIjp7Im9iamVjdEFwaU5hbWUiOiJBY2NvdW50IiwicmVjb3JkSWQiOiIwMDE3RjAwMDAyUzZnOUhRQVIiLCJhY3Rpb25OYW1lIjoidmlldyJ9LCJzdGF0ZSI6e319&count=3 _________________________________________________________________________
In above URL you …