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
h8r41dh8r41d 

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) 
ShamilShamil

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."