Troubleshooting·Advanced·4 min·Updated 2026-10-05
“No such column” when the column exists
An Apex class pinned to an older API version cannot see fields added in a later one — even through dynamic SOQL.
A tax adapter queried the rate object for a postal code and a product code. The query returned No such column. The fields were visible in the object describe, present in the UI, and populated with data.
The cause was the API version of the Apex class. Those two fields exist from API 66.0 onward. A class saved against an earlier version does not see them, and dynamic SOQL does not escape the restriction — which is what makes this one expensive, because building the query as a string is exactly what you try next.
The signal to recognise: a field that exists everywhere except inside one Apex class. Check the class's API version before touching the query.
This sits alongside a related trap in the same family: a freshly deployed custom field is invisible to SOQL and Apex until field-level security is granted, and SOQL answers No such column for that too — which reads exactly like a failed deployment.