function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Use of apiVersion Parameter

<apex:page action="{!NewAgreement}" standardController="Agreement__c" apiVersion="14.0" extensions="AgreementAmendRef_Extension" title="Agreement:~Salesforce-DeveloperEdition"> ...



Is it necessary to specify an API version for a VF page? Is there a benefit? A drawback? Within the Salesforce interface the API version for this page is shown as 13.0. As youcan see, in the Page tag we set it to 14.0.


The main question over here is if we leave the api parameter off will the page "float up" to using the latest API version? The concern is that if we specify an API we are somehow holding back the page.






You have to say that you want upgrade your code to another API version as far as I know(either by saying yes when you are prompted or doing it yourself). As to your other question I'm not entirely sure. New functionality will form part of new API releases so I'd guess that it would 'hold' you back as some point.




Message Edited by wesnolte on 06-12-2009 08:19 AM

Actually I believe that apiVersion attribute on the page component is not being consumed at all, probably a mistake that it is exposed.


You'll want to use the apiVersion field that exists on the page or component entity (not VF component) if you're using the API, or if you go to the Version Settings tab on the edit page in setup for either a page or component, you can set the API version via the dropdown there.


There is some documentation about what the version controls, but the high level idea is that it controls which version of the API your page runs in (example, if you're using the standardController, which automatically creates a SOQL query for you based on the references on your page, that query will get executed in the API version of your page.  So if, for example, a new field became available on Account inversion 16.0 of the API, your page would have to have an API version of 16.0 in order for you to directly reference that field on your page.)  There are also various behaviors that we have versioned, which are all documented in the release notes.