Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using metadata API to retrieve the LastModifiedBy of an Object. But, it returns me only one User.

I wanted to know if we can track, the Users whoever modified the Object. Is it possible by any means?

share|improve this question
up vote 7 down vote accepted

Starting with Winter'16 the SetupAuditTrail object has now been exposed via the Salesforce API's and within Apex via SOQL. Its pretty much a mirror of the CSV download, accept for the Delegate User (though since this is documented, this could be a bug or something i'm missing). The following is a sample query from my latest blog where i dig into it a little further...

List<SetupAuditTrail> stuffDoneByConsultants = 
    [SELECT Id,
        Action,
        CreatedBy.Name,
        CreatedDate,
        Display,
        Section 
     FROM SetupAuditTrail 
     WHERE CreatedBy.Email LIKE '%xyzconsulting.com%'];
share|improve this answer
1  
Thanks @Andrew :) that looks like great information... – San Tosh Oct 19 '15 at 11:06
1  
Andrew - this is a great feature fr reporting! – Chirag Mehta Oct 28 '15 at 6:27
    
Yes, SetupAuditTrail is SOQL'ble ie searchable. Metadata Search AppExchange app now supports searching Setup Audit Trails. View/Install app from goo.gl/qOJCIM. Disclosure : Apologies for self promotion :) – Chirag Mehta Jan 18 at 10:12

I think you're looking for the Setup Audit Trail. This setup screen should display the last 20 metadata modifications, the last 6 months can be downloaded as csv.

Setup > Security Controls > View Setup Audit Trail

View Setup Audit Trail

Update: Apparently this data is not exposed/supported by the Metadata API (or any other). There is an idea on the IdeaExchange on which you can vote: Make Audit Setup Trail History available via the API

share|improve this answer
    
i want the same via metadata API. Is it possible through any other means, other than metadata? I need it in external application. – San Tosh Mar 4 '14 at 14:05
    
Sorry, did not pay attention to your tags, it may help if you explicitly mention that in your question. I interpreted "any means", as truly "any means". – Samuel De Rycke Mar 4 '14 at 14:07
    
hehe..no problem :) – San Tosh Mar 4 '14 at 14:08
    
I don't know the metadata/docs well enough to be certain what you want isn't possible so i'll leave that up to someone else. – Samuel De Rycke Mar 4 '14 at 14:14
1  
Nope, still no API access for the setup audit trail AFAIK. See this Idea: success.salesforce.com/ideaView?id=08730000000glm9AAA – jkraybill Mar 4 '14 at 14:23

Yes we can track all changes to salesforce through Audit Trial. There are some tools available in appexchange like AutoRABIT where we can track changes to all metadata memebers with given date and time. By using advanced search options we can search by date,metadata type,modified user,component name etc.

enter image description here

Thanks,

Niranjan.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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