How to handle “No such column found in entity” error even though the column exists in entity

H

Sometimes when you try to access some columns dynamically in your class, you may come across the error “No such column found in entity”  even though when you check and u see that the column is present in your entity.

This is due to the API version difference between the Class and the entity. There are many columns which have been added in the entities after the API version 27.0. If your class version is below 28.0 you may come across such error.

for example: If you are trying to access ‘billingaddress’ column in ‘Account’ entity through a class with API version 27.0 you will get this error.

No such column ‘billingaddress’ on entity ‘Account’. If you are attempting to use a custom field, be sure to append the ‘__c’ after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

To solve this issue you just have to change you class’s API version to the latest in the version settings tab which is just above your workspace besides ‘Apex Class’ tab.

About the author

Taha Sadikot
By Taha Sadikot

Category