+ Start a Discussion
Abhishek Pal 33Abhishek Pal 33 

How to write data in csv?

Hello Everyone,

I am stuck at one point that My requirement is that I want to write data in csv once my record in inserted successfully in salesforce or failed. For eg: there is column in csv (Flag) I want to make it true when record in inserted succcess.

Thanks in advance.
Vasani ParthVasani Parth

What tools are you using to import the data?

Refer this post : similar question has already been answered here with apex code:

Let me know if this helps.
Abhishek Pal 33Abhishek Pal 33
Hi Parth,

I am using document object to read the csv files which is uploaded in a  shared folder.
You need to query on the document and get the body of it in string format, and manipulate it as per your requirement.
Help link : http://sfdcsrini.blogspot.com/2014/04/how-to-read-csv-file-from-apex_17.html