+ Start a Discussion

Why does the standardSetController try to enforce validation when I call .next() ?

Hey all


I'm try to build an interface that is dual purpose record viewer / editor. I'm running into the problem of not being able to go to the next page if some records aren't passing validation (though they are not edited). The data pre-dates the validation rules, so when you view them, you can't move to the next page.


Does the setcontroller automatically try to save records when you call next() ?

Best Answer chosen by Admin (Salesforce Developers) 

Try setting the immediate attribute to true in your commandLink/commandButton/actionFunction - whichever one you use to call the next() method, e.g.

<apex:commandButton action="{!paginator.next}" immediate="true" value="Next" />


Meaning of the immediate attribute is the following:

"A Boolean value that specifies whether the action associated with this component should happen immediately, without processing any validation rules associated with the fields on the page. If set to true, the action happens immediately and validation rules are skipped. If not specified, this value defaults to false."