4

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!

2
  • Can you Check Tooling Api option in Developer console and try to fetch the created date alone in query? Mar 21, 2019 at 9:37
  • Using Tooling Api show me this: sObject type 'Interest__mdt' is not supported.
    – Wyrncael
    Mar 21, 2019 at 10:09

1 Answer 1

7

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.

5
  • Thanks! My workarround was create a custom field named CreatedDate with a default value of NOW(). But i'm interested in use a better standard option.
    – Wyrncael
    Mar 21, 2019 at 11:27
  • For now, no standard solution.
    – m Peixoto
    Mar 21, 2019 at 11:58
  • Ok, thanks! I'm going to open an idea.
    – Wyrncael
    Mar 21, 2019 at 12:08
  • 1
    good idea! Post here and I will vote it up!
    – m Peixoto
    Mar 21, 2019 at 14:16

You must log in to answer this question.

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