Wednesday, 18 May 2016

Part 2 – DML operation with CLIq


For other DML operations (Insert, Update, Upsert, Delete), you have to repeat the above steps. It means you will be having different folder for each operation.

Example – For Export we have created Export_Accounts directory structure likewise we have to repeat the same steps for other DML operation.
  •  Select the operation and enter different process name.

  • Enter the Object API name (Query in case of Export) and create the CLI files.


  • It will create folder same as process name 


Instructions for Configuring DML

C:\dataloader\cliq_process\Import_Accounts\read 
  • Replace this file with your csv. Do not change the file name. Just replace the existing .CSV file with your file.
  • The first row should have the field names. Make sure to update the .sdl file. C:\dataloader\cliq_process\Import_Accounts\config\Import_Accounts.sdl.         
  • Open processname/config/processname.sdl. Create a mapping with the CSV column header on the left and the Salesforce Field on the right.


Note: Insert will not require id mapping, update/delete requires id mapping. 

Now the configuration part is done. Just we need to schedule the bat file, which can be scheduled on Windows using Windows Scheduler.

Thanks!!

Saturday, 23 April 2016

Data Loader CLIq (Command Line Interface quickstart)

Introduction:

Data Loader is tool provided by Salesforce for bulk import or export of data. Sometimes, we come across many scenarios where we want to automate the operations or we perform the same task repeatedly.

In this case, we can use Salesforce Data Loader Command Line Interface (CLI).

CLI runs Data Loader from the command line but it is challenging and difficult to set up. So there CLI quickstart (CLIq) comes into help. It will generate all required files for Command line data loader.

  Installation Steps:

  •  Install Data Loader version 17.0 or later.
  • To download Data Loader, login to Salesforce and go to
       Set Up -> Data Management -> Data Loader -> Download Data Loader
  • Download the latest version of CLIq
          https://code.google.com/archive/p/dataloadercliq/downloads
  • Unzip cliq.zip and copy & paste the ‘cliq’ folder into your Data Loader home directory
      Typically, this is: C:\Program Files\salesforce.com\Data Loader\cliq



 Configuration Steps:


Go to C:\Program Files\salesforce.com\Data Loader\cliq and open cliq.properties file for proxy settings.




Note: By default, cliq will set for Production. To use it for the sandbox, uncomment line 23 (remove # and save it).


Let’s Get Started – (Part 1 – Data Export)

To run CLIq, run cliq.bat on Windows (cliq.sh on UNIX).


1. Choose an Operation
2. Enter the process name (string). Example: Export_ Accounts


3. Click on Next and enter your org credentials (username, password + security token)
4. Enter Query (Export) or Entity (Object API Name).



5. Review results and create Data Loader CLI Files


Note: When trying to run process.bat for Salesforce Data Loader from the command line, I encountered an error, "The system cannot find the path specified".

Follow the below steps to resolve the error:


1) Create a folder dataloader (no spaces) in C:\ drive (C:\dataloader)
2) Copy dataloader.jar ,JAVA folder and cliq folder from C:\Program Files\salesforce.com\Data Loader to C:\dataloader
3) Run cliq.bat from cliq folder

A directory will be created with name same as Process name.

·         C:\dataloader\cliq_process\Export_Accounts




As we selected Export Operation, it will automatically create a Export_Accounts.csv file with all data in C:\dataloader\cliq_process\Export_Accounts\write.

Thanks!!