According to the Release Notes for Custom Metadata Types:

Use SOQL queries to retrieve data from custom metadata types and their records. Unlike other Apex transactions, you can make unlimited SOQL queries for custom metadata types and records.

The Custom Metadata Allocations and Usage Calculations help doc also states unlimited queries can be issued.

The phrasing you can make unlimited SOQL queries strongly implies that neither the query limit nor the row limit apply when retrieving these records. Is that the case?

1 Answer 1


The query limit does not apply (unless you select a rich text field). However, the row limit still applies. This conclusion can easily be proven by running a simple script:

List<My_Metadata__mdt> metadata = [SELECT DeveloperName FROM My_Metadata];
system.assertEquals(0, Limits.getQueryRows(), 'This assertion fails because the row limit is consumed');

You must log in to answer this question.

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