+ Start a Discussion

Download Setup Audit Trail programmatically...

If I got to Setup > Security Controls > View Setup Audit Trail it shows me the latest 20 entries in the Setup Audit Trail and then gives me a link to download.  The link points here...


The id is the SFDC Org Id.  I need to programmatically gain access to this log, there are three ways I see this being possible...

-Download the log a different way

-Find out what the CONFIRMATIONTOKEN is and how I can generate it

-Access the Setup Audit Trail directly somehow with out needing to download the full log


Do anyone have any insite into how I can make any of these three methods work?


Hi Max, 


did you get an answer to your question. Incidentally I am also searching for a solution for exactly the same requirement. Although I was willing to use apex as well ? Please share any leads you might have. 


thanks in advance.


- Gunish


There is a much better way to track ALL changes to data in Salesforce, not just 20 fields. Relational Junction for Salesforce has a unique history tracking feature that captures ALL versions of records in a relational database of your choice (SQL Server, Oracle, MySQL, PostgreSQL, Sybase, DB2, GreenPlum). There is a primary database table for each object that is replicated as often as you like, including real-time, and a secondary table that contains all prior versions of the records. This gives you a perfect compliance solution, including the ability to recover data to a point in time with all relationships intact. Relational Junction for Salesforce is bi-directional, using a control field in each database record to determine what to create, update, or delete in Salesforce. This provides a great integration platform, as well as a solution for complex reporting requirements and compliance.


We were looking for a way to track it with out going to an outside database.  Sorry this is not a solution to the problem. 


Did anyone ever find a solution for this ?


The only thing that I had to do to make it work for us was to Use Watir + Autoit. 

I wrote some scripts on a dedicated machine to visit the webpage, and find the link and click on it, (old school, web testing automation selenium grade stuff) and then use AutoIt, to ftp it over to a location on a scheduled day.




Hi Gunish


                  I am looking for a solution on this and i tried diferent ways of doing it by api , visualforce page or apex and unfortunately it is not working .If you could share the procedure that you have done it wil be much useful for me .Thanks in advance.

Niranjan GattupalliNiranjan Gattupalli
 This can be possible with Salesforce API's but in differrent way.
There is an app AutoRABIT (https://appexchange.salesforce.com/listingDetail?listingId=a0N30000000ptkwEAA) in appexchange which uses Salesforce API's and does track all metadata changes based on given date/time,metadata type/name,createdby/modifiedby user etc..Unlike View Setup Audit Trail which dispalys only latest 20 changes where as from this app we can track all changes.
  Sample screenshot is

 Sample view from this app
Sravika Birudaraju 10Sravika Birudaraju 10

Please do let me know if you found some solution for this. I need to download the audit trail data programmatically or without downloading if I can access all the records for 1 month atleast.

Sravika Birudaraju 10Sravika Birudaraju 10
I got it thanks :)
Rudy ShivanandaRudy Shivananda
Hi Sravika,

What is the solution that you found ? Could you please share