I have enabled State and Country picklist feature and I am using this query in a web service class:

SELECT BillingStateCode FROM Account

But I am getting:

No such column 'BillingStateCode' on entity 'Account'.

I am using BillingStateCode and BillingCountryCode fields in another class and there it works fine. If I try to execute above query in developer console, there too it works without error. Why does just this one class fail?


If you are getting this error in apex class then I suggest you to update the API Version of your class.

You will get this error if your Apex Class version is less than 27. Update the API version to 27+ and it will compile.


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.