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
DeepikareddyDeepikareddy 

Do we have alternative method to download as textfile and csv file otherthen contenttype and Dataloader concepts


1)contentType="text/plain/#Test.txt".
2)Dataloder 

 Question:
Do we have any sample  method or predefined Method to download a  list of values in the form of Text file or Csv file.Except the Content type or Dataloader

Ex: list<account> acc = [select id and name form account limit 5];

//how to download the id and account name in text file and Csv file with out using content type and dataloader .. 

Thanks 
Deepika

  
Best Answer chosen by Deepikareddy
ANUTEJANUTEJ (Salesforce Developers) 
Hi Deepika,

So I found this link in which it mentioned different ways to download data, according to your use case you can implement taking refernence from here.

https://douglascayers.com/2016/03/20/salesforce-easy-ways-to-export-data-as-csv/

Regards,
Anutej Poddaturi

All Answers

ANUTEJANUTEJ (Salesforce Developers) 
Hi Deepika,

There are multiple ways iby which you can download data including the above two.

>>VF page  with contentType.
>>Apex class.
>>Workbench.
>>Dataloader.
>>Out of the box functionality data export
>> Through reports. [You can create a report and after that you can download]

Is there a specific reason why you don't want to use Data loader or the ContentType?.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thank you!

Warm regards!
Anutej Poddaturi
ANUTEJANUTEJ (Salesforce Developers) 
Hi Deepika,

So I found this link in which it mentioned different ways to download data, according to your use case you can implement taking refernence from here.

https://douglascayers.com/2016/03/20/salesforce-easy-ways-to-export-data-as-csv/

Regards,
Anutej Poddaturi
This was selected as the best answer
DeepikareddyDeepikareddy
Thank you.. ! AnuTej