+ Start a Discussion
Anand@SAASAnand@SAAS 

System.VisualforceException: Modified rows exist in the records collection!

 

Page size is 10, Total records = 17.code that is being called:

 

 

this.setCtlr.next();
//populateData iterates using getRecords()
populateData();

 

 

Debug Log is below:

 

18:51:36.359|USER_DEBUG|[4]|DEBUG|>>>>>>>>>>>>>>>> MyMarketController>>>>>>>>>>>setCtlr.TotalSize=17
18:51:36.359|METHOD_EXIT|[4]|System.debug(ANY)
18:51:36.359|METHOD_EXIT|[202]|ALMLogUtils.log(String, String)
18:51:36.359|METHOD_ENTRY|[203]|01pQ00000004ZfQ|ALMLogUtils.log(String, String)
18:51:36.359|METHOD_ENTRY|[203]|ApexPages.StandardSetController.getHasNext()
18:51:36.359|METHOD_EXIT|[203]|ApexPages.StandardSetController.getHasNext()
18:51:36.359|METHOD_ENTRY|[4]|System.debug(ANY)
18:51:36.359|USER_DEBUG|[4]|DEBUG|>>>>>>>>>>>>>>>> MyMarketController>>>>>>>>>>>setCtlr.HasNext=true
18:51:36.359|METHOD_EXIT|[4]|System.debug(ANY)
18:51:36.359|METHOD_EXIT|[203]|ALMLogUtils.log(String, String)
18:51:36.359|METHOD_ENTRY|[204]|ApexPages.StandardSetController.next()
18:51:36.359|EXCEPTION_THROWN|[EXTERNAL]|System.VisualforceException: Modified rows exist in the records collection!
18:51:36.360|METHOD_EXIT|[204]|ApexPages.StandardSetController.next()
18:51:36.360|CODE_UNIT_FINISHED|MyMarketController invoke(next)
Best Answer chosen by Admin (Salesforce Developers) 
Anand@SAASAnand@SAAS

Found the issue. Was changing overwriting a field value in my Apex Controller when iterating over the getRecords() collection. 

All Answers

Anand@SAASAnand@SAAS

Found the issue. Was changing overwriting a field value in my Apex Controller when iterating over the getRecords() collection. 

This was selected as the best answer
ashoknaglikar1.3945534997003162E12ashoknaglikar1.3945534997003162E12
How did you get around the problem? Anand