Salesforce, Talend (tMap), Data Loading...Avoid VLookup

Saturday, February 26, 2011 by Aslam - The Alexendra
Hi All,
Today I will give you some demonstration about data loading with Talend. I am taking one special case in which generally people use VLookup function from excel to match the lookup ids and fill the records csv column and then upload. For example, you have one CSV file for Contacts which you want to insert into salesforce, that CSV contains 'Account Name'. But you need AccountId to successfully insert contact records. For solving this people generally do this approach.

1) Fetch all account names and ids from salesforce and make one csv
2) Use the VLookup function to match Account Name from csv2 to CSV1 and set the extra column in CSV1 for AccountId (generally people struggle here :) )
3) Then use final CSV1 to upload the data

So, I am here to tell you easy upload approach using Talend tMAP to avoid any VLookup headache and simply upload data successfully.

Follow this approach.
1) Create a new Job
2) Select File->tFileInputDelimited and set your CSV input file here
3) Select Business->Salesforce->tSalesforceOutputBulkExec, set your salesforce credentials where you want to upload the data
4) Select Business->Salesforce->tSalesforceInput, set your salesforce credentials from where you want to fetch the Account Ids and Account Names data, Set your query here
5) Select Processing->tMap, this is the heart of whole process
6) Double click on tMap, set the mapping here, CSV1->AccountName TO tSalesforceInput->Name. Drag relavent columns to your salesforce output file, Set the ID from tSalesforceInput to tSalesforceOutputBulkExec->AccountId
7) Now save your complete Job
8) Run the job and it will give you output as results.

Here is the Screencast to see complete process as vedio.

Here are more links which can help you to run and use Talend

Hopefully this will help some people to try Talend and finding its benifits.

Aslam Bari

Barcode, Salesforce and PDF

Wednesday, February 16, 2011 by Aslam - The Alexendra
Hi All,
Recently I faced one issue where i need to generate Barcode on the fly in VF and also render that as PDF. I searched on Net and community, found some people have done Barcode generation using Javascript. But in my case i need to render it as PDF and VF does not support Javascript when renderAs PDF. So i decided to go the way to generate Barcode image. The first thing came in my mind is PHP/GD way to generate Barcode image and use that url in VF to show image. Then i found this site useful and very useful PHP script which fits my need

I used this script, done some modification in this and hosted on my site And used in my VF page as below:-

<apex:image value="" />

Here is some details about how you use the url and parameters to generate barcode:
barcode: [any text to render as barcode]
text: [0 or 1]
format: [jpeg/png/gif]
width: [the width you want]
height: [the height you want]

It works great if my VF render as normal HTML page, but as soon as i make it renderAs="PDF", VF again not works, it does not allow dynamic generated images. So again i got disappointed.
Then i thought again and did apex code to fetch the dynamic binary data generated my PHP site url and save it into attachment and use that url in my VF page. I was thinking this time i will win for sure, but again it did not work. HttpResponse does not allow Blob response, it always gives response as String and that mingled my image data. Disappointed again.

Then finally i have decided to create dynamic generated barcode on PHP and save as temprary images and use that url in my img tag and renderAs="PDF", this time i got success :)

Here is the working demo for my work:-

If you need complete code for above demo site, here is the link:

Enjoy barcoding :)

Aslam Bari

ApexDoc Eclipse Plugin For IDE

Tuesday, February 1, 2011 by Aslam - The Alexendra
Hi All,
I am very happy to announce that now ApexDoc is available as Native "Eclipse Plugin". So no more need to go command line and provide parameters. You can simply go to your Force.IDE, select your classes folder, right click on that and Generate your ApexDoc, all in one place. Isn't it cool :)

Ok, so here is the guidelines, how to install the plugin and use it.

1) Go to

2) Download the plugin from there. It will give you one file. Unzip that file.

3) You will get one "com.apex.doc_1.0.0.jar" file. Copy this file.

4) Go to your eclipse installation directory and find your plugins folder there, For example D:\Eclipse\plugins

5) Paster the copied jar file into this directory.

6) Now restart (if eclispe is already running) your eclipse

7) Now go to any Project you have setup in your eclipse. Open the classes folder.

8) Right click on that folder, from shortcut menu select "", a sub menu will appear, you can see "Generate ApexDoc..." menu item in your submenu.

9) Now click on "Generate ApexDoc...". One ApexDoc dialog box will open.

10) All options here are self explanatory. The "Source Directory" is already filled up your selection. The "Target Directory" is where you want to generate output Documentation generated. "Home HTML File" is your sample home file for index page. "Author File" is for header areas for documentation.

11) Select appropriate options and Click on "Generate" button. It will generate documentation on your selected target directory and you will be prompted one message dialog that says "DONE"

12) If there is any issue, not generated your documentation, you can find one log file generated in your eclipse installation with name "apex_doc_log.txt".

So, this is very useful for developers and non programmers to use this plugin tool. You can also check one screenshot here:

For learning how comments syntax will be in your code refer my previous blog:

The plugin is in pre-mature stage and may contains bugs. Feel free to report me all bugs or enhancement you find, on my email. I will try to fix those.

So enjoy documenting :)

Aslam Bari