Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.