Explore Courses Blog Tutorials Interview Questions
0 votes
in Salesforce by (11.9k points)

I have written an Apex class in a Salesforce managed package which uses the managed version of the apex-lang library package:

global class MySorter implements al.Objectcomparator

I am considering eliminating the dependency on the managed package by distributing apex-lang with my package. Having installed the unmanaged version of apex-lang, I try changing my class:

global class MySorter implements Objectcomparator
Upon trying to save, I get an error:
Error: Compile Error: Required class relationships must be maintained: MySorter Implements al.ObjectComparator[Previously Managed] at line 1 column 8
Why would such a restriction be in place? Any ideas on getting around it?

1 Answer

0 votes
by (32.1k points)
edited by

A drawback this has is that it stops you from changing your contract with a code that is outside your package. Since you marked your code as global, there could be callers of this code from outside as well that actually rely on the implementation of the al.ObjectComparator interface.

To learn in-depth about Salesforce, sign up for an industry-based Salesforce Certification!

Browse Categories