SOQL unbounded set of fields error only surfaced upon deployment attempt

Issue #2284 resolved
René Görgens created an issue

Hi Scott,

According to the FIELDS() documentation, FIELDS(ALL) and FIELDS(CUSTOM) are not allowed at all in inline Apex.

The inspection shows no problems for the following inline query:

However upon deployment, the problem is surfaced: “The SOQL FIELDS function is not supported with an unbounded set of fields in this API.“

As a sidenote, I could not deploy a class meta with API=56 while the SOQL has this issue. To update the API version, I had to manually intervene on the connection.

Comments (6)

  1. René Görgens reporter

    Great! Thanks for making the error message somewhat more precise than the SF documentation 😀

  2. Scott Wells repo owner

    Actually that message isn’t correct. It’s not allowed in Anonymous Apex either. That was a mistake on my part. It’s only allowed in standalone SOQL queries, and it also requires a LIMIT clause of at most 200 rows. Updating as appropriate.

  3. René Görgens reporter

    My bad, I misread the documentation. It works as a standalone query because you pass it via SOAP.

  4. Log in to comment