You need to sign in to do that
Don't have an account?

How to import data from .csv to Salesforce using Apex code?
Hi,
I have to export data from the .csv file( in a shared folder) to the corresponding fields in my Salesforce account using Apex code.
Kindly advice me how to achieve this...
Also share if some sample codes are available.
Thanks in Advance
Ambily
I have used this code and modified to my usage, this works simply great http://www.forcetree.com/2010/08/read-and-insert-records-from-csv-file.html
Cheers!
Hi Iffu,
Have you checked for governer limits?
If my CSV contains more than 50k records then what is best way to use in this code example.
Please help me.
Thanks
Urvi
Hi Urvi,
Yes, thats the important question but as I said, I only used the basic design of this program and modified it as per my usage. The CSV parser is good in it. Inorder to meet the governer limits, I used all of the data into Maps and minimised the use of SOQL and DML statements.
In your requirements, with a large data something like this, you can use batches to insert your data once you process it using CSV parser. You can find more about using batches here http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm
Cheers!
I am facing the same problem.Could you please help? What did you do to solve the problem?
Thanks,
Shivani