salesforce csv 1000 limitation issue
2015-06-25 15:35
645 查看
http://salesforce.stackexchange.com/questions/69555/view-state-error-while-creating-generating-an-csv-file
https://developer.salesforce.com/forums/?id=906F00000008xtsIAA
You can use a list of lists and nested repeaters to get around the 1000 records in a list limit. Here's an example:
Controller
VisualForce Page:
view
source
print?
This should allow you to have up to 10,00,000 records.
June 7, 2012
·
Like
1
·
Dislike
0
https://developer.salesforce.com/forums/?id=906F00000008xtsIAA
You can use a list of lists and nested repeaters to get around the 1000 records in a list limit. Here's an example:
Controller
01 | public class exportCSVController { |
02 |
03 | public List < List <myClass > > myList { get ;set;} |
04 |
05 | public exportCSVController() { |
06 | myList = new List < List <myClass > > (); |
07 | List <myClass > temp = new List <myClass > (); |
08 |
09 | for (Integer i = 0 ; i < 2500 ; i++){ |
10 | if (temp.size() < 1000 ){ |
11 | myClass m = new myClass(); |
12 | m.val 1 = 'val1 ' + i; |
13 | m.val 2 = 'val2 ' + i; |
14 | temp.add(m); |
15 | } |
16 | else { |
17 | myList.add(temp); |
18 | temp = new List <myClass > (); |
19 | myClass m = new myClass(); |
20 | m.val 1 = 'val1 ' + i; |
21 | m.val 2 = 'val2 ' + i; |
22 | temp.add(m); |
23 | } |
24 | } |
25 | myList.add(temp); |
26 | } |
27 |
28 |
29 | public class myClass{ |
30 | public string val 1 { get ;set;} |
31 | public string val 2 { get ;set;} |
32 | } |
33 | } |
view
source
print?
1 | <apex:page controller= "exportCSVController" cache= "true" contentType= "text/csv#Export.csv" language= "en-US" > |
2 | "Col A" , "Col B" |
3 | <apex:repeat value= "{!myList}" var= "a" > |
4 | <apex:repeat value= "{!a}" var= "asub" > |
5 | "{!asub.val1}" , "{!asub.val2}" |
6 | </apex:repeat > |
7 | </apex:repeat > |
8 | </apex:page > |
June 7, 2012
·
Like
1
·
Dislike
0
相关文章推荐
- [LeetCode] Repeated DNA Sequences
- 仿QQ侧滑效果(swifit)
- unique_ptr使用简介
- IOS本地消息推送(UILocalNotification)
- getContextPath、getServletPath、getRequestURI的区别
- easyui menubutton和menu对齐
- Druid使用说明书
- UISearchbar设置placeholder字体颜色大小
- require与require async的区别
- Google+ 团队的 Android UI 测试
- UI界面库
- EasyUI回车提交表单
- require.js模块化管理和加载js(按需加载)简单实例教学
- HackerRank - "Xor subsequence"
- 关于easyui datebox的记录
- Android有关Volley使用(十)至Request和Reponse意识
- Adobe Flash Builder 4 注册码破解方法
- UIView常用的一些方法小记之setNeedsDisplay和setNeedsLayout
- androidUI抽屉效果菜单---代码
- UITableView的registerClass forCellReuseIdentifier用法详解