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
VarunCVarunC 

ViewState error on PageLoad not Postback

Maximum Viewstate size exceeded ... error on Page Load is occuring and nothing loads on the visualforce page. The size reportedly exceeds to around 150K .. :( ....

 

Now I searched around in forums but I figured that using Transient keyword can minimize the Viewstate size, but my understanding says that even Transient keyword usage will ONLY save me when my page Postback and that the viewstate does not gets saved for un necessary variables .. but I don't think with Fresh page load this keyword gonna make any difference.

 

Please help ... I even could not Test and verify it in code ... is there any tool with which I can Test  & verify the Visualforce Page's ViewState size ???

WesNolte__cWesNolte__c

Hey

 

What does your page contain? Any documents? Does your controller hold any Blobs? If the page you're navigating to is Page B, does Page A (the page you come from) use the same controller as page B?

 

Wes

VarunCVarunC

Actually its a Visualforce page that is acting like a Tab. and error occurs when I click on the Tab link to open the page.

 

The page doesn't deals with any Document or Attachment object. there is no Blob type variable used in the class.

 

The Tab is desired to show Some Records from Events/Tasks & one more custom Objects. The recordsa are displayed using wrapper classes since I need to implement checkbox selection for the displayed records. There is a button on display such that it processes selected records.

 

But problem for me is this that, I'm not even able to click the button, the error occurs simply on Page Load.

 

For an Estimate the records count on display can be in this range 1 - 4000 records. No more than 4000 records can be shown on this page because a List object can hold 1000 records and I created 4 list objects for 4 different types of ObjectTypes.

WesNolte__cWesNolte__c

Yeah I've only had this issue on pageloads, and it happens when there's just too much data (blobs are always a likely candidate). I'm guessing if you enforce limits on your queries (something like 10 to start with) the page loads?

 

Wes

VarunCVarunC
Actually the situation is slightly different ... I am not producing this issue in my Dev org, but its in customer org, who has installed the package. That's why I just wanted to do some calculation based on which I can impose my limits, and for that I might be needing some tools to detect and know how much ViewState size is being utilised on that page ....
ConejoConejo

Wes,

 

  What is the implication if Page A & Page B use the same controller & navigate to each other?

 

  I have a couple pages doing that and am having Internal Server Errors. I submitted cases, but haven't heard back yet.

 

 

Thanks,

 

Rich C.

WesNolte__cWesNolte__c

Ah, this is the complaint of many people.. the closest tool you have is are the limit methods. Although there's nothing specific about the viewstate in there you might be able to use other limits indirectly to gauge your situation e.g. heapsize.

 

Good luck,

Wes

WesNolte__cWesNolte__c

Hey Rich

 

Internal server errors are problems SF have on their side of things i.e. the Java that supports/is underneath the code fails for some reason. The number you get tells them the stacktrace they should be looking at.. these errors 'fix themselves' most of the time if given a bit of time.

 

The implications of what I mentioned are that, if pages are sharing a controller, and the controller becomes bloated (the vars are carrying alot of data from page to page) then you can also hit the above mentioned error.

 

Wes

VarunCVarunC

I did used about 4-7 Controllers ... on the page but None of them is Interacting with Data in class on page load.

 

3 Components use same class but no data is interacted until a button is clicked on the page. Other 4 are just simple Divs or html tags which are used to customize display on the Tab.