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
Raghavendra ARaghavendra A 

Visualforce page and View State

Hi All,

I am working on the following requirement where on a Case detail page I need to provide a custom button, when clicked we need to show Case detailes and all its related records in detailed mode as a PDF. We need to show in a PDF the following:
  • Case record details
  • All related items on a Case in detailed mode, not as a list view for ex, Customers associated a Case, and other custom objects. 
  • Even the Customer object that I mentioned is a Custom object that has many related items, even that also has to be shown in the detailed mode. 
All of the above needs to be show in a PDF in one page on click of a button. 

I am mainly worried about the view state here. There would be so many records returned, many SOQL queries and even all fields needs to be displayed in detailed mode in a single page. Can any of you suggest me the best approaches to take here so that I do not hit a View state error. Also any suggestions on approaching to this solution will be highly appreicated. 

Thanks a lot in advance!

Raghu
Best Answer chosen by Raghavendra A
Ravikant Saini 1Ravikant Saini 1