nerdexam
Salesforce

PDII · Question #277

There is an Apex controller and a Visualforce page in an org that displays records with a custom filter consisting of a combination of picklist values selected by the user. The page takes too long…

The correct answer is A. Use a StandardSetController or SOQL LIMIT in the Apex controller to limit the number of records. See the full explanation below for the reasoning.

Question

There is an Apex controller and a Visualforce page in an org that displays records with a custom filter consisting of a combination of picklist values selected by the user. The page takes too long to display results for some of the input combinations, while for other input choices it throws the exception, "Maximum view state size limit exceeded". What step should the developer take to resolve this issue?

Options

  • AUse a StandardSetController or SOQL LIMIT in the Apex controller to limit the number of records
  • BAdjust any code that filters by picklist values since they are not indexed.
  • CSplit the layout to filter records in one Visualforce page and display the list of records in a second
  • DRemove instances of the transient keyword from the Apex controller to avoid the view state error.

How the community answered

(37 responses)
  • A
    76% (28)
  • B
    16% (6)
  • C
    3% (1)
  • D
    5% (2)

Community Discussion

No community discussion yet for this question.

Full PDII Practice