Anonymous Apex running under wrong API version

Issue #2355 duplicate
Jason Clark created an issue

I have a Summer '23 Preview scratch org (created with sfdx org create scratch --release preview ...). I’m trying to run anonymous apex that calls String.join(setOfStrings, ',') where setOfStrings is a Set<String>; this relies on the Summer 23 change that makes Sets iterable. When I run it via IC2 Anonymous Apex window, I see a compilation error that Set isn’t iterable. If I run the same code in Developer Console, it works fine.

Looking at the IC2 Connections list, the entry for my org showed API version 57, and it was not editable. Updating sourceApiVersion in my sfdx-project.json file changed it to version 58, but I still get the same error. Refreshing the connections makes no difference; I've also tried restarting WebStorm. Running sfdx org display shows API version 58.

How can I force the Anon Apex window to use API 58?

Comments (4)

  1. Scott Wells repo owner
    • changed status to open

    Jason, the issue is that IC2 is invoking the Salesforce SOAP and REST APIs using API endpoints with the latest released API version number, in this case v57.0. That will be updated when the IC2 is updated for Summer '23.

    That generally doesn't occur until the new platform release is available in all orgs, though I often provide an early access build of IC2 with minimally the API version number updated for the SOAP and REST API endpoints. I might do that later this week. If/when I do, I'll let you know that such a build is available.

  2. Scott Wells repo owner

    Jason, I’m going to track all Summer ‘23-related activity through #2358. Please add yourself as a watcher there if you’d like to be notified about a Summer '23 pre-release build when available.

  3. Jason Clark reporter

    @Scott Wells Ok, that actually makes sense that it’s not fully supported yet, and it’s not a big deal; I can use Dev Console if needed for the time being. I assumed I had a setting wrong somewhere. Thanks for the update.

  4. Log in to comment