Let's say you have a details page of a Contact.

I would like to be able to track changes that were made to Contact, such as field name changes, field type changes, etc.

I assumed that there would be some kind of LastModifiedDate for if an admin made changes to the object or page layout but I can't seem to find one anywhere.

My use case is that I need to provide these kinds of changes as a web service to a client. Given a certain date/time, I need to send all the changes to the field names, page layout ordering, fields becoming required etc.

I think I can use DescribeSObject for most of this but I'm stumped how I'm going to check when the changes were made. Can anyone shed any light on this?


You can find those changes logged under Setup->Security Controls->View Setup Audit Trail. The full details of what's tracked are listed here: https://help.salesforce.com/htviewhelpdoc?id=admin_monitorsetup.htm&language=en_US

However, those changes listed aren't as detailed as you like and I don't know if you can download the CSV of all changes programatically without screen-scraping that page for the download URL as it contains a confirmation token.

You can track changes to the meta-data using the meta-data API but that will only let you determine the differences since the last time you checked and won't tell you who made the changes or when and there are possibly some changes that aren't covered with that method.

  • This is useful, but is there no way to access it in code? Can I somehow parse the csv file in the web service? – George S. Aug 13 '12 at 17:41
  • Not beyond screen-scraping that page to get the download URL. I don't think Salesforce has the ability to track changes at the level of detail you want. You might be able to combine the date/time logging with changes retrieved via the metadata API. – E.J. Wilburn Aug 13 '12 at 17:48

A heavy handed approach would be to use Version Control (SVN, GitHub, etc) to version control your Metadata Objects (Objects, Page Layouts, etc) in your Sandbox environment. You would then need to use Change Sets or the Force.com IDE to push your changes from Sandbox into Production. But first you would need to checkin your latest version of the metadata into your version control.

You would also have to put into place operational measures to ensure deployments go from Sandbox -> Production via a Change Control process and that changes are checked in / out of the Version Control via the Eclipse IDE and your version control plugin.

This would come at the cost of speed obviously. You wouldn't be able to make declaritive changes on the fly anymore in Production. But you would have a auditable history of all your changes and descriptions of your changes.

Then, depending on the Version Control Software, you could expose the audit history via a Web Service to your client that queries your Version Control software, not SFDC directly.


Solves your problem. Provides detailed audit history of metadata changes.


Heavy Handed, slows down your deployment time. Requires additional setup of Version Control Software, as well as interface for Web Service to that Version Control Software for the client.

Again, heavy handed I know. But its feasible and would solve your issue. Many large scale SFDC implementation use version control to control their metadata.

  • This doesn't quite suit my needs as the page layout will depend on individual users (different field-level security etc.) but it looks like a good solution. – George S. Aug 17 '12 at 21:05

take a look at the history object: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_relationships.htm#i1422454

you should be able to access the audit information through SOQL.

  • 1
    Looks like this only detects changes in values, not field labels... – George S. Aug 13 '12 at 19:08
  • must have misread. – ebt Aug 13 '12 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.