You need to sign in to do that
Don't have an account?
HarithaAkella
Visualforce Page - Number of rows issue
Hi,
I have created a visualforce page as per the requirement in my team and that looks like below image.
I am able to see only 20 rows in this table, whereas the original list view contains more than 1000 records.
I am on group edition on salesforce.
My requirement :
1. I need to have all the 1000+ rows displayed on the same page, I just want to scroll down to see them all. (Right now in the imkage page I see a limit of only 20 rows, I want the same page to display all the rows)
2. i have implemented pagination after looking at few forums, The prev and next buttons that you see in the image. However clicking on any of them throws the error "Modified rows exist in the records collection! "
Please help me implement 1 , if not atleast 2 should be in working condition.
Thanks,
Haritha
I have created a visualforce page as per the requirement in my team and that looks like below image.
I am able to see only 20 rows in this table, whereas the original list view contains more than 1000 records.
I am on group edition on salesforce.
My requirement :
1. I need to have all the 1000+ rows displayed on the same page, I just want to scroll down to see them all. (Right now in the imkage page I see a limit of only 20 rows, I want the same page to display all the rows)
2. i have implemented pagination after looking at few forums, The prev and next buttons that you see in the image. However clicking on any of them throws the error "Modified rows exist in the records collection! "
Please help me implement 1 , if not atleast 2 should be in working condition.
Thanks,
Haritha
Can you share the code you used to implement this page?
<apex:commandButton value="previous" action="{!previous}"></apex:commandButton>
<apex:commandButton value="next" action="{!next}"></apex:commandButton>
Seems that your controller are limiting the list that you're using to show the table. Try to see if your query doesn't have any LIMIT or similar clause that restricts the results.
Important: showing all the rows of your table may cause your page to exceed the limits of loading, isn't recommended showing all the rows.
Probably some code in your controller is causing the limitation to load the records and the bug when you try to paginate.
Below is some of my code, to give you an idea:
My controller:
<apex:page showHeader="true" sidebar="true" standardController="NewOrder__c" recordSetVar="Orders" cache="false">
The filters you are seeing is nothing but my various list views I created by applying filters:
<apex:form id="os1" >
<div class="hideCurrDate">
<apex:pageBlock title="Orders-Status as of {!Now()} " id="thePB" >
<apex:pageMessages />
<apex:PageBlock title="Filter">
<apex:commandLink target="_blank" styleClass="btn" style="text-decoration:none;padding:4px;"
action="https://koolgator.lightning.force.com/lightning/o/NewOrder__c/list?filterName=00B39000007z4UkEAI" value="ALL"/>
<apex:commandLink target="_blank" styleClass="btn" style="text-decoration:none;padding:4px;"
action="https://koolgator.lightning.force.com/lightning/o/NewOrder__c/list?filterName=00B39000007z4ZeEAI" value="IN PROGRESS"/>
<apex:commandLink target="_blank" styleClass="btn" style="text-decoration:none;padding:4px;"
action="https://koolgator.lightning.force.com/lightning/o/NewOrder__c/list?filterName=00B39000007z4ZoEAI" value="DELIVERED"/>
<apex:commandLink target="_blank" styleClass="btn" style="text-decoration:none;padding:4px;"
action="https://koolgator.lightning.force.com/lightning/o/NewOrder__c/list?filterName=00B39000007z4cEEAQ" value="COMPLETE"/>
</apex:PageBlock>
<apex:pageBlockButtons >
<apex:actionPoller action="{!quicksave}" interval="30"/>
<apex:commandButton value="Save" action="{!save}" oncomplete="rcode();"/>
<apex:commandButton value="Quick Save" action="{!quicksave}"/><br><br></br></br>
</apex:pageBlockButtons>
and then this is part of my table, SO__C etc are fields in Orders custom object:
<table value="{!Orders}" width="100%;font-size: 10px" var="opp" id="accsTable" styleclass="tablesorter">
<td><apex:inputField value="{!ord.SO__c}" style="width: 30px;font-size: 10px"/></td>
<td> <apex:inputField value="{!ord.MPO__c}" style="width:30px;font-size: 10px"/> </td>
<td> <apex:inputField value="{!ord.PO__c}" style="width:80px;font-size: 10px"/> </td>
<td> <apex:inputField value="{!ord.Account__c}" style="width:130px;font-size: 10px"/> </td>
<td> <apex:inputField value="{!ord.Name}" style="width:170px;font-size: 10px"/> </td>
You can check this and how to make the pagination here: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_sosc_pagination.html
Another point: all visualforce tables and the repeat are limited to hold only 1000 records.
About pagination, are you sure that the rows have no changes when you hit the pagination buttons? Try to expose the fields with <apex:outputFields> to see if the pagination is working at least.
I tried to run query earlier, but its disabled. When I researched I found that its not enabled for our edition. https://help.salesforce.com/articleView?id=code_about.htm&type=5
When I use apex pageblocktable and use the pageblock buttons for pagination they work for me. Problem is when I use the standard html table as mentioned in my code earlier instead of pageblocktable or datatable, these buttons, next prev they dont work.
Am pretty sure, because the moment I click on any of the buttons leads me to "Modified rows exist in the records collection! "
I suppose you're making use of a html table because of your headers. You can try this make the "General Information" line in HTML. Then, add your pageblocktable with <apex:facet name="header"> with the values of last line of our header. Maybe you have to use some css to style and adjust the sizes to fit correctly, but maybe it will work for you.
You can use an IF statement in your outputField with your criteria and add css styles, something like that:
Let me know if it worked.
<apex:column value="{!ord.SO__c}" style="width: 20px; height: 20px"/>
Once you change to InputText value, that's when we see the error "Modified rows exist in the records collection! "
<apex:column> <apex:InputText value="{!ord.SO__c}" style="width: 20px; height: 20px"/> </apex:column>
But I have the requirement to input fields, I just dont want to view them, i should be able to edit them?
My requirement is this:
<apex:column value="{!ord.RCVD_Order__c}" styleClass="{!if( AND ( NOT(ISBLANK(ord.RCVD_Art_work__c) ) ,ISBLANK(ord.RCVD_Order__c)),'background-color:yellow;width:20px','background-color:white;color:black;width:20px;font-size:10px')}""/>
This is not working!
I am waitin on implementing pagination when pageblock table columns have InputText value, that's when we see the error "Modified rows exist in the records collection! " and my prev, next links wont work?
Does pagination not work with InputText?