If my apex class API version is 28, will there be any issue if i try to use List class contains method ?

I checked in debug logs, even if class has api version 28, i am able to use List contains method. Does api version anywhere else in my org override class api version making class api version meaningless ?

  • 2
    If you are stuck with api 28, you can make yourself a little utility class with API level 42 that can perform the contains() method for you. – Caspar Harmer May 24 '18 at 1:09

Contains method was introduced recently; I guess in version 42.0.

To use the it, you would have to upgrade API version of the class.

Note: Salesforce recommends to upgrade the API version after every 3 releases. But make sure to check if anything breaks after the upgrade.

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.