how to get all the metadata changes after a given date.

Tried using metadata api's listMetadata(), this gives all the data and here we can't filter using dates. This will run into limits for reports and custom fields.

Is there a way to filter metadata changes by lastmodifieddate, createdbyid ?


For objects supported by Tooling API, you can simply write a query for this. Open the Developer Console, click on the Query tab, enter the Tooling API query, and check the "Use Tooling API" checkbox.


SELECT TableEnumOrId, DeveloperName FROM CustomField WHERE LastModifiedDate > 2018-09-01T00:00:00.000Z

Note: This means you'll have to query all tables you want separately.

Note 2: Not all objects are supported, so if that's the case, you might need to source an alternative method, like querying the SetupAuditTrail and parsing manually. This goes back about six months, though.

  • Do we have tables for all metadata types like reports, workflowrules etc ? – ab0369 Dec 19 '18 at 15:30

Trying to retrieve date information from the Tooling API is quite difficult. The results will vary depending on which call is made and what Metadata Types are supported.

A much easier way is to Retrieve the Metadata in question. Look at the checkRetrieveStatusResponse structure. Under fileProperties you will see createdByName, createdDate, lastModifiedByName and lastModifiedDate. This method returns all of the data information in one API call.

  • I want list of metadata that is modified after a given date – ab0369 Jan 4 '19 at 16:12
  • 1
    Right. Do a retrieve of the relevant Metadata Types, look through the checkRetrieveStatusResponse structure, and find the dates that are after your given date. Then compile a list of those metadata types. There is no automatic or simple method to get this information. – Bill Appleton Jan 4 '19 at 19:46
  • I tried that too but for customfields I cannot use it as it gives me limit error 10000 or 39mb – ab0369 Jan 4 '19 at 21:10
  • 1
    You are looking at a gigantic org. You can divide the transaction into pieces and everything will work the same way. For Custom Field dates the Tooling API is a better choice. The Metadata API will only give you dates for Custom Objects, but the Tooling API will give you dates for individual fields. – Bill Appleton Jan 4 '19 at 22:50

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.