When i tried to run the inline visualforce page it throws an error which i understand was due to session timeout. It shows an error telling

An administrator has changed the definition of page or component /apex/opendocuments. Refresh your page and try again Previous version = 6. Current version = 7.

enter image description here

I am just curious to know where Salesforce maintains the versions (previous version, current version) of Apex classes, visualforce pages, etc?


The "version tracking" feature is simply a counter variable that stores how many edits have occurred to a Visualforce element (pages, triggers, etc are not subject to this tracking value, at least far as we can tell). It is an internal value that we don't have access to, and it solely used to prevent errors from changes in the page's element structure while it's running in a browser. The page stores the version it was loaded as, and will abort with the error if the current database version is not the same as the version the page was loaded as.

For example, MyPage.page is at version 21, and a user loads version 21 and starts filling it out; MyPage running in their browser stores version 21 into its view state. An admin deploys a new version, and the database's page is now at version 22. The next time the user attempts to post back to the server, because of an actionFunction, commandButton, commandLink, actionSupport, etc, if the view state's version doesn't match the server's version (at this point, it would not), they would get an error.

Changing the controller, extensions, or triggers related to the page will not trigger a version change error, because any fields or properties that are referenced by the page will be forced to remain present by the compiler.

|improve this answer|||||

Salesforce is preparing a pilot program that would contain integrated version tracking that would be accessible through the UI. See https://success.salesforce.com/ideaView?id=08730000000BrBKAA0 tentatively scheduled for Summer '15

|improve this answer|||||

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.