You need to sign in to do that
Don't have an account?
Batch Insert of Records in CSV file
Hello,
I am planning to do a insert of a large number of records that are inside of a CSV file. In the past we have provided the client a solution of using a Java program that reads the CSV file and makes the Insert by making use of Salesforce API.
However, now that the batch mode is available I was wondering if we can make use of it in this perticular scenario. Is there a way that we can can parse a large CSV file and insert records into Salesforce using salesforce batch mode.
Right now it appears that the batch mode can only run on records that are already inserted into Salesforce. I want the other way round, I want batch mode to be operational on records that are yet to be inserted into Salesforce.
It some one already did this, please post the code and I guess it woud be helpfull for lot of people who are running in this issue.
Have you used the Data Loader? Its a client-side tool that can import data into salesforce.com from a CSV file through the API.
Hello aalbert,
Yes i have used data loader in the past ,and i am aware that we an do the APEX API calls using Flex, java Script sitting right inside salesforce app.
But I thought Using apex is much cleaner solution and i think it would definitely be faster as everything is happening inside the server unlike - Dataloader or any application running in the Browser. Another main reason for not using dataloader is our client is a financial client and they are not keen on using any open source software due to their security concerns.
Please let me know if any one has an apex solution for my issue.
For loading data from a local CSV you will need to use the web services API. Batch Apex is for Batch processing records already stored in salesforce. If your client is not comfortable using the Data Loader, we have a number of enterprise ETL partners with pre-built integrations to salesforce.
http://sites.force.com/appexchange/results?filter=a0L30000001Qp7TEAS&sort=6
As CVJ says, you could look at ETL tools that will be able to provide you with the technology you need. You could look at Talend, an open source solution: there are components that make it possible to work with salesforce.
----
Talend Open Studio is an open source ETL tool for data integration experts with a user-friendly GUI, easy to learn for a non-technical user. What distinguishes Talend, when it comes to business users, is the tMap component which allows the user to get a graphical and functional view of integration processes. For more information: http://www.talend.com/
ehrenfoss,
This is great. What about testing this function? Can you post what the code coverage looked like for this?
Thanks!
I created my CSV via MS Excel and when I saved it it uses \r\n not \n as the new line char(s).
So the last value in the columns always had a \r char at the end which causes problems when trying to test the string value.
I change the code to this: