function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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 :