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?


1 Answer 1


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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .