You need to sign in to do that
Don't have an account?
sfadm sfadm
Generate csv report via apex
Hello,
Please advise how to generate a .csv file report via apex?
What I would like to achieve is to automatically generate a .csv report file in the beginning and at the end of a working week.
Please advise how this can be achieved with an apex code?
I'll strongly appreciate if you can include an apex source code example.
Please advise how to generate a .csv file report via apex?
What I would like to achieve is to automatically generate a .csv report file in the beginning and at the end of a working week.
Please advise how this can be achieved with an apex code?
I'll strongly appreciate if you can include an apex source code example.
Here is the sample code to create or generate a CSV file using apex code. The below code will query all SetupAuditTrail object records and stored the generated CSV file in document object folder.
Usually Setup Audit Log in salesforce will provide only last six month of data. But when we need a specific range of logs, then we have to go for a custom logic.
The below query will provide specific date range of Audit logs, Sample Batch Code: Hope this helps.
Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
I have tried your code snippet but i am not able to fetch record data in excel sheet, as i have made some changes to pull account object record.
Please kindly help me to get records in excel sheet.
Thank you,
Ameer