[SalesForce] How to query the Created Date of a Custom Metadata Record

I want to query the Created Date of a Custom Metadata Record. I'm trying this:

SELECT Id, DeveloperName, CreatedDate FROM Interest__mdt ORDER BY CreatedDate LIMIT 1

But I'm getting this error:

No such column 'CreatedDate' on entity 'Interest__mdt'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

How can i get the last record? Thanks!

Best Answer

You have only these standard fields on Custom Metadata record:

  • DeveloperName
  • Id
  • Label
  • Language
  • MasterLabel
  • NamespacePrefix
  • QualifiedApiName

My sugestion is creating a custom field that you can Order by in the way that it is good for you.