I'd like to be able to pull a listing of Apex classes, triggers, and components that have been created or modified after a certain date. Is there an easy way to do this?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
If your aim is to do something manually as a once-off, you can use the "Query Editor" of the "Developer Console" to run these queries (adding
for classes and triggers. But I don't think many/any other components are exposed in this way, so you will have to use the metadata API for a general solution.
You have two approaches you can take. One is using the Tooling API and the other is to query for the objects directly in Apex.
You should be able to get this type of information using the Tooling API. Specifically look at ApexClass, ApexTrigger, and ApexComponent. You can essentially pass a query to it (like the example form the documentation):
If you need to explicitly do this in Apex, you best bet is to just query for the objects. As with above, you will want to use:
For recently created Pages and Classes