I have a managed package installed in a subscriber org.

Today I just tried to call some of the packages managed Apex in the subscribers org.

It failed with:

Dependent class is invalid and needs recompilation: Class.TheManagedPackageNamespace.ClassFromTheManagedPackage: line 498, column 13
Method removed by critical update: getFieldsDescribes: []

This is a Sandbox org on Spring '17.

Do I need to create a new version of the managed package for this critical update? What critical update is it?

This might be tricky as the packaging org is still on Winter '17.

The corresponding line from the managed package source:

system.debug(LoggingLevel.Debug, 'X.Y() - getFieldsDescribes:' + Limits.getFieldsDescribes() + '/' + Limits.getLimitFieldsDescribes());

It looks like the Limits method in question was deprecated in Summer '14, but should have kept working for API 30.0 and earlier. Source

3 Answers 3


There's one available in my org that seems relevant:

Remove Deprecated Limits Method

Update Name
Remove Deprecated Limits Method

Auto-Activation Date
Fri May 19 00:00:00 GMT 2017

Impact Details

Removed the following static Apex methods from the Limits class.

  • getChildRelationshipsDescribes() and getLimitChildRelationshipsDescribes()
  • getFieldsDescribes() and getLimitFieldsDescribes()
  • getFieldSetsDescribes() and getLimitFieldSetsDescribes()
  • getPicklistDescribes() and getLimitPicklistDescribes()
  • getRecordTypesDescribes() and getLimitRecordTypesDescribes()
  • getScriptStatements() and getLimitScriptStatements()

Remove Deprecated Limits Method

Can't find anything related to it in the Release Notes though, nor can I answer your other questions. Still, this might help investigate.

UPDATE: Salesforce have amended the release notes to include Removal of Deprecated Apex Limits Methods (Critical Update)

  • 1
    That certainly seems like it. It was activated by the admin in the subscriber org on 2/7/2017. So today. Feb 8, 2017 at 1:18
  • Woo! Maybe they can roll it back until you can patch? Seems like it should be easy to remove any calls to this method.
    – Adrian Larson
    Feb 8, 2017 at 1:19
  • 2
    Yup. Easy enough to tidy up now that I know what was causing it. Will fix in the next package release and talk to the admin about holding off on the critical update until it is ready. Feb 8, 2017 at 1:26
  • @DanielBallinger Wow they added that quickly! Thanks for the update.
    – Adrian Larson
    Feb 9, 2017 at 19:03

These methods were deprecated in Summer 14. You've had almost three years to remove those methods from your code. You should remove this code from your package as soon as possible. This critical update was to bring this to your attention, because salesforce plans on removing this method entirely, but can't do so until everyone's stopped using it. In the interim, your subscribers can turn off the critical update (for now), but you need to fix this before Summer '17.

  • 4
    The code has been on API v30.0 for some time now and I've taken a "If it ain't broke don't fix it approach". It certainly brought it to my attention :) Feb 8, 2017 at 1:21
  • 1
    @DanielBallinger Yeah, I realized that it must have been the case. It's important for ISV's to not ignore release notes. I didn't even realize that those methods had been removed myself.
    – sfdcfox
    Feb 8, 2017 at 1:22
  • I posted this so hopefully others can learn from my mistakes :) Are there any release notes for this critical update in Spring '17? I'm struggling to find any mention of it. Feb 8, 2017 at 1:29
  • 1
    @DanielBallinger I couldn't find it in the docs either. It appears to be an oversight by the documentation team.
    – sfdcfox
    Feb 8, 2017 at 1:33
  • 2
    I've tried to raise it with the docs team - twitter.com/FishOfPrey/status/829141416177659904 Feb 8, 2017 at 1:36

Check the method out here: limit class

Because describe limits are no longer enforced in any API version, this method is no longer available. In API version 30.0 and earlier, this method is available but is deprecated.

So you aren't seeing this because the method was removed because it is no longer necessary to track those.

  • 1
    Yes, I noticed that they were deprecated. Still it's a bit concerning that it is breaking existing deployed managed packages. Feb 8, 2017 at 1:15

You must log in to answer this question.

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