Find your content:

Search form

You are here

Getting LastModifiedDate of Admin changes

 
Share

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?


Attribution to: George S.

Possible Suggestion/Solution #1

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.


Attribution to: E.J. Wilburn

Possible Suggestion/Solution #2

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.


Attribution to: ebt

Possible Suggestion/Solution #3

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.

Pros:

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

Cons:

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.


Attribution to: CoryCowgill
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/362

My Block Status

My Block Content