Designing a job to extract binary objects from Salesforce.com

The Salesforce.com connector supports downloading binary object type from Salesforce.com using a flat file in real-time mode.

About this task

To design a job to extract binary data from Salesforce.com, complete the following steps:

Procedure

  1. Create a Pack for Salesforce.com extraction job.
  2. In the InfoSphere® DataStage® and QualityStage® Designer client, create a new parallel job.
  3. In the Designer Client Palette, click Packs and drag the Salesforce.com connector stage icon to the Parallel Canvas.
  4. In the Designer Client Palette, click File and drag the sequential file to the parallel canvas.
  5. To define the job as an extraction job, draw an output link from the Salesforce.com connector stage to the sequential file stage.
  6. Double-click the Pack for Salesforce.com connector stage to open the link properties.
  7. Specify your Salesforce.com login credentials and URL, or load them from a saved connection file.
  8. In the Read operation field, select the Query or QueryAll operation.
  9. Click Browse Objects to select a business object.
  10. Click the Large Object Operation category.

Example

Note: 1. This new category Large Object Operation is enabled when you select the extract operation of Query or QueryAll. 2. Select Yes for the property Enable Load or Extract Large Object via flat file, so that downloading binary files using the flat file is enabled. 3. Define the property Flat File Column Name as this functionality supports extracting large object via flat files. 4. The Flat File Column Name should be defined as Base64 binary field, such as the Body field in an object on Salesforce.com. 5. Define the property Flat File Folder Location, as the location where the files are downloaded. 6. Update the Flat File Content Name job property, which contains the Field Name of the Object that contains the name of the file to be downloaded. By default this is the Name field of the Object, which can be changed. 7. Define the property Flat File Overwrite. If this is set as True, the file to be downloaded, if already existing is overwritten. If this is set as False, a new file is created every time with the date and time appended to the beginning of the file name. 8. The file is downloaded in the directory that is specified by the property Flat File Folder Location. Once download is complete, the Base64 output column, like the field Body contains the absolute path of the file that is downloaded. 9. The patch does not support UNC or remote file locations.

Example Value

Example Job

Example Job
Enable Load Large Object via flat file:
This property must be set as Yes.
Flat File Column name:
The name of the flat file column name, which is Base64 field.
Flat File Folder Location:
This property defines the folder in which the file must be downloaded on the local ETL Server.
Flat File Content Name:
This property defines the Field Name of the Salesforce.com Object which contains the name of the file that needs to be downloaded.
Flat File Overwrite:
This defines whether the file if it is already existing on the disk must be overwritten. If True, then the file is overwritten, else a new file is created, and the name of the file is appended with the date and time of the file creation. For example, if the file 00P70000008V0E5EAK_ABCFile.pdf" is already existing on the disk and the job is run to download the attachment, then If the property Flat File Overwrite is Yes, then the file 00P70000008V0E5EAK_ABCFile.pdf" is overwritten. If the property Flat File Overwrite is No, then a new file is created, by pre-appending the date and time of creation to the file name, which is placed in the same directory as the above file. The file name looks like 2012-08-06_11-39-29_ 00P70000008V0E5EAK_ABCFile.pdf.
Example output file with "Flat File Overwrite" as "Yes"
"00P70000008V0E5EAK","/opt/sforce/hugeFile/P70000008V0E5EAK_i46depsf.pdf",
"i46depsf.pdf","0017000000O902EAAR"
"00P70000008V0E6EAK","/opt/sforce/hugeFile/P70000008V0E6EAK_SALESFORCEJCConnector.bmp",
"SALESFORCEJCConnector.bmp","0017000000OEZ7VAAX"
"00P70000008V0DcEAK","/opt/sforce/hugeFile/P70000008V0DcEAK_IS_QuickStartGuide.pdf",
"IS_QuickStartGuide.pdf","0017000000O902FAAR" 
"00P7000000Bu0HTEAZ","/opt/sforce/hugeFile/P7000000Bu0HTEAZ_SalesforceExecutable.exe",
"SalesforceExecutable.exe","0037000000iJ1s0AAC"
Example output file with "Flat File Overwrite" as "No"
"00P70000008V0E5EAK","/opt/sforce/hugeFile/2012-09-20_07-06-17_
00P70000008V0E5EAK_i46depsf.pdf",
"i46depsf.pdf","0017000000O902EAAR"
"00P70000008V0E6EAK","/opt/sforce/hugeFile/2012-09-20_07-06-18_
00P70000008V0E6EAK_SALESFORCEJCConnector.bmp",
"SALESFORCEJCConnector.bmp","0017000000OEZ7VAAX"
"00P70000008V0DcEAK","/opt/sforce/hugeFile/2012-09-20_07-06-19_
00P70000008V0DcEAK_IS_QuickStartGuide.pdf",
"IS_QuickStartGuide.pdf","0017000000O902FAAR" 
"00P7000000Bu0HTEAZ","/opt/sforce/hugeFile/2012-09-20_07-06-21_
00P7000000Bu0HTEAZ_SalesforceExecutable.exe",
"SalesforceExecutable.exe","0037000000iJ1s0AAC"
:
Note: 1 In the examples only required fields are mentioned for the Objects. You can include other fields also in the schema, which is permitted by the Salesforce Objects. 2. For selecting the ParentId, you might need to manually clear the child fields.