Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 6 down vote accepted

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.

share|improve this answer
    
That certainly seems like it. It was activated by the admin in the subscriber org on 2/7/2017. So today. – Daniel Ballinger 7 hours ago
    
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 7 hours ago
1  
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. – Daniel Ballinger 7 hours ago

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.

share|improve this answer
3  
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 :) – Daniel Ballinger 7 hours ago
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 7 hours ago
    
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. – Daniel Ballinger 7 hours ago
1  
@DanielBallinger I couldn't find it in the docs either. It appears to be an oversight by the documentation team. – sfdcfox 7 hours ago
2  
I've tried to raise it with the docs team - twitter.com/FishOfPrey/status/829141416177659904 – Daniel Ballinger 7 hours ago

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.

share|improve this answer
    
Yes, I noticed that they were deprecated. Still it's a bit concerning that it is breaking existing deployed managed packages. – Daniel Ballinger 7 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.