19

Back in 2016 we created a Custom Metadata Type with about 3000 rows. There is a trigger that reads all 3000 rows (via SOQL) and creates a map. This has been working for years, until Winter '19.

Now, when we run the test Class for our trigger (in winter '19), we get this error message:

System.QueryException: myCustom__mdt received too many records from the external data source

Summer '18 Orgs work just fine like they always have.

SO! When I try to debug that error message, I find this knowledge article. Too many records received from external data source

This basically says:

When using an External data source configured to use Server Driven Pagination and for a query on an external object from this external source results in server responding with a result page size greater than 2000 records results in the below error - ...

SO! Are Custom Metadata Types treated like external data sources and the limit is only now being enforced in Winter '19? Is there a limit on CMTs that I am violating and can't find a reference to?

  • Whoa. That's crazy. – Adrian Larson Sep 19 '18 at 18:43
  • 2
    I opened a Case with SF Support... it's been escalated to the point where R&D is looking into it. I think it's a winter '19 bug. I hope it gets cleared up before release. I've been the little voice behind a known issue before, but never something like this! – John Thompson Sep 19 '18 at 19:17
  • 2
    Does it work if you query once with LIMIT 1500 and then another with OFFSET 1500 and merge them? Slapdash non-scalable solution but at least it gets you through the storm. – Charles T Sep 19 '18 at 20:07
  • @CharlesT I haven't tried it. A member of our Dev team was heading down that path while we awaited and answer from support. I might get some feedback on this tommorow. "Slapdash", I like that! I'm going to start using that term I learned from Charles T. – John Thompson Sep 19 '18 at 21:27
  • Has anyone escalated this to the Partner Community? – Charles T Sep 20 '18 at 1:22
5

This is a Winter '19 bug. I've heard several other folks have the same issue and they put in tickets.

Known Issue

  • 1
    Confirmed by SFDC... "As informed, this is confirmed as a known issue in Salesforce. This is likely to be fixed by 1st week of October(safe harbour). Until then as a workaround you can try to modify the query to retrieve 2000 records." – John Thompson Sep 20 '18 at 14:14
  • In case anyone is following.. this appears to be fixed in Winter '19 – John Thompson Oct 1 '18 at 17:56

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.