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?

3 Answers 3


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,
     FROM SetupAuditTrail 
     WHERE CreatedBy.Email LIKE '%xyzconsulting.com%'];
  • 1
    Andrew - this is a great feature fr reporting! Commented Oct 28, 2015 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 :) Commented Jan 18, 2016 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

  • i want the same via metadata API. Is it possible through any other means, other than metadata? I need it in external application.
    – ipradhansk
    Commented Mar 4, 2014 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". Commented Mar 4, 2014 at 14:07
  • hehe..no problem :)
    – ipradhansk
    Commented Mar 4, 2014 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. Commented Mar 4, 2014 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
    Commented Mar 4, 2014 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



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .