When I create class in eclipse I get version no:27.But When I create a new class in Salesforce UI it is 29.I have updated http://wiki.developerforce.com/page/Updating_the_Force.com_IDE force.com IDE but it still says 27.How to update it ?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
It's been a while since I've used the Eclipse IDE (I use MavensMate + Sublime Text now), but every class should have a "-meta.xml" file associated with it. Inside this file is where the version is assigned. In the past the default version was only updated when new versions of the IDE were released, forcing you to manually adjust classes until that point.
You can change that meta.xml file on a Sandbox and then deploy it to Production in order to change the version number.
Another option is to login into your Sandbox and lookup the Apex Class in question. Then click over to the "Version Settings" tab and change it to whatever you wish. Then in the Eclipse IDE, Refresh the Apex Class from the Server.
I use the Force IDE and have the latest version installed. It creates API version 29 classes by default.
It is possible your update did not complete correctly. So the first step is to check the version you are running by selecting Eclipse -> About Eclipse and then clicking on the Force.com IDE icon (some sort of X using a red arrow). That is on a Mac - on Windows it is something like Help -> About.
So if the version is wrong repeat the upgrade watching out for errors and check again afterwards. If the version is right then I don't know what the problem is.
Note that the IDE releases lag the platform releases by a few weeks and moving to a new version of the IDE requires projects to be upgraded which is disruptive and litters your version control system with fairly purposeless changes. Personally I do not upgrade every time there is a new version of the IDE because of that disruption. As others have posted, you can manually move a class to the latest API version if you need some new feature. I guess I am saying that 27 isn't so far behind that you necessarily need to change.
Some useful questions seem to be:
I'll be honest - I've got Eclipse setup but not really used it so I personally can't comment of the validity of the answers on the links, but they seem inline with Jonnybro's answer.