2

I have an error in a method using List.indexOf. When running in anonymous window in sandbox, it works. But in production I get the following error:

Method does not exist or incorrect signature: void indexOf(User)

Why do I get this error? How can I fix it?

Method Error

9

This method was introduced in the Spring '18 Release, which likely hasn't been rolled out to your org yet. You can see the calendar for major releases at https://status.salesforce.com/status. For instance, if you were on na31, this release would be rolled out Friday night (Eastern Standard Time).

PS - Make sure you use API Version 42.0 or greater if you want this method to compile. EDIT - apparently this assumption is incorrect, and you will be able to make use of this method in any version.

  • 2
    @AdrianLarson This is being backported to earlier versions. You can use List.indexOf without moving to version 42, but it will only compile in Spring '18 orgs regardless. – sfdcfox Jan 31 '18 at 19:40

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.