Currently we are using a custom list view Visual Force page button for mass actions to export data to excel sheet in salesforce classic.
Objects and relations:
- Static List (Custom object with Master relationship to Static List Member )
- Static List Member (Custom junction object to static list and static list member )
- Contact (Standard object with Master relationship to Static List Member )
Expected behavior for the visual force page:
On the static List, list view select the static list and click export
The export in the excel file should return all the static list members for each static list.
-Known limitations: The number of items in a collection that can be handled by iteration components is 10,000 in read only mode.
Current Behavior: Export for each list is maxed out at 1999 rows.
I'm trying to figure out if the current behavior is a salesforce bug or Am I missing something? Any help appreciated, below is the code snippet.
<apex:page standardController="Static_List__c" recordSetVar="staticLists" contentType="application/vnd.ms-excel#Static_List_Export{!NOW()}.xls" readOnly="true">
<!-- Vf page to generate the static member list records into a single excel sheet using standard controller functionality-->
<!-- Using content type along with date time stamp to create unique name every time the excel report is created-->
<!-- Using recordsetvar to fetch all the records from the list view-->
<head>
<style>
#contacttable {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#contacttable td, #contacttable th {
border: 1px solid #ddd;
padding: 8px;
}
#contacttable tr:nth-child(even){background-color: #f2f2f2;}
#contacttable tr:hover {background-color: #ddd;}
#contacttable th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
</style>
</head>
<table id="contacttable">
<tr>
<th>Static List: List Name</th>
<th>Prefix</th>
<th>Name</th>
<th>Company Name</th>
<th>Status</th>
<th>Email opt-out</th>
<th>Email</th>
<th>Phone</th>
<th>Street Address</th>
<th>City</th>
<th>State</th>
<th>Country</th>
<th>Zip</th>
</tr>
<!-- Iterating over the selected records on the list view -->
<apex:repeat value="{!selected}" var="sL">
<!-- Iterating over the child records using relationship-->
<apex:repeat value="{!sL.Static_List_Members__r}" var="sLM">
<tr >
<td> {!sLM.Static_List__r.Name} </td>
<td> {!sLM.Contact_Name__r.Salutation}</td>
<td> {!sLM.Contact_Name__r.Name}</td>
<td> {!sLM.Company_Name__c} </td>
<td> {!sLM.Contact_Status__c} </td>
<td> {!sLM.Email_Opt_Out__c} </td>
<td> {!sLM.Email__c} </td>
<td> {!sLM.Contact_Name__r.Phone}</td>
<td> {!sLM.Contact_Name__r.MailingStreet}</td>
<td> {!sLM.Contact_Name__r.MailingCity}</td>
<td> {!sLM.Contact_Name__r.MailingState}</td>
<td> {!sLM.Contact_Name__r.MailingCountry}</td>
<td> {!sLM.Contact_Name__r.MailingPostalCode}</td>
</tr>
</apex:repeat>
</apex:repeat>
</table>