Salesforce Certified Platform Developer II — Question 43
A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that users are encountering ViewState errors when using it in Production.
What should the developer ensure to correct these errors?
Answer options
- A. Ensure queries do not exceed governor limits.
- B. Ensure properties are marked as Transient.
- C. Ensure properties are marked as private.
- D. Ensure profiles have access to the Visualforce page.
Correct answer: B
Explanation
The correct answer is B because marking properties as Transient helps reduce the ViewState size by preventing them from being serialized, which is crucial for performance. Options A and C do not directly address the ViewState issue, while D pertains to access permissions rather than ViewState management.