Export records from List view – ListView API
As part of the Winter’15 release salesforce introduced the List View API features which helps us to get details and records of list views for an object. I was started exploring more about the List view API and trying to build an use case using that. So I searched about List View in the IdeaExchange site then found that many users are looking for a solution to export records to excel directly from the list view.
I built a solution for that Idea, which helps user to download all the records directly from the List view for both standard and custom object. You don’t have to make any change in the code to use this functionality for different objects. All you need is to create a custom button for that object as mentioned below. Lets take an example for Account object
1. Go to Setup –> Accounts –> Buttons, Links and Actions
2. Click ‘New Button or Link'
3. Enter Label, Name and select display type as ‘List Button’

4. Content source as “Onclick Javascript” and paste the below code
Then include the button in the List view page of the object. Now open any list view of the account object and click the ‘Export to Excel’ button. It will export all records of that list view. Repeat the above steps for creating button for other objects.
Lets see the logic behind the scene, firstly lets take a look into the ListView API. Currently ListView API is available in both SOAP and REST format. Following are the functionalities you can call using REST service. Documentation link
List Views - Get the List of List views for a particular object. Run the following in the workbench to get the result.
Next moving on the code the apex class will call the list view API describe function using HTTP callouts. Then using the JSON parser, parse the JSON string output to get details like SOQL and Columns information. Once we get the SOQL query of the list view then its not a big deal to display the records in a visualforce page. The table in the visualforce page will display the columns dynamically based on the columns in the list view.
1. Go to Setup->Remote Site –> New
2. Add the Name and in the URL enter the domain name of your org
3. Then click save
So now we can able to export records directly from the list view. I have tested this functionality with around 20K records. You can also check my previous article here to exporting more records without hitting view state limit or collection size limits. The complete source code is available here.
You can also deploy to your org by clicking the below button

I built a solution for that Idea, which helps user to download all the records directly from the List view for both standard and custom object. You don’t have to make any change in the code to use this functionality for different objects. All you need is to create a custom button for that object as mentioned below. Lets take an example for Account object
1. Go to Setup –> Accounts –> Buttons, Links and Actions
2. Click ‘New Button or Link'
3. Enter Label, Name and select display type as ‘List Button’
4. Content source as “Onclick Javascript” and paste the below code
Then include the button in the List view page of the object. Now open any list view of the account object and click the ‘Export to Excel’ button. It will export all records of that list view. Repeat the above steps for creating button for other objects.
ListView API in Winter15:
Lets see the logic behind the scene, firstly lets take a look into the ListView API. Currently ListView API is available in both SOAP and REST format. Following are the functionalities you can call using REST service. Documentation link
List Views - Get the List of List views for a particular object. Run the following in the workbench to get the result.
URL - /services/data/v32.0/sobjects/Account/listviewsDescribe - It will provide the definition of particular list view, including SOQL.
URL - /services/data/v32.0/sobjects/Account/listviews/{ListId}/describeResults – It will return the records of the particular list view including column details.
{ListId} – Enter the ID of the List view
URL - /services/data/v32.0/sobjects/Account/listviews/{ListId}/resultsTo know more about the List view API functionality check the "Super ListView viewer" by Andrew Fawcett
{ListId} – Enter the ID of the List view
Next moving on the code the apex class will call the list view API describe function using HTTP callouts. Then using the JSON parser, parse the JSON string output to get details like SOQL and Columns information. Once we get the SOQL query of the list view then its not a big deal to display the records in a visualforce page. The table in the visualforce page will display the columns dynamically based on the columns in the list view.
The reason why I’m not using the results listview API functionality in my code is, the size is default to 25. So we can’t get more than 25 records from the list view using REST API.
Remote Site Setting:
Since we are making HTTP callouts in apex class, we have to setup remote site to call salesforce by itself. Follow the below steps1. Go to Setup->Remote Site –> New
2. Add the Name and in the URL enter the domain name of your org
3. Then click save
So now we can able to export records directly from the list view. I have tested this functionality with around 20K records. You can also check my previous article here to exporting more records without hitting view state limit or collection size limits. The complete source code is available here.
You can also deploy to your org by clicking the below button

the article is nice.most of the important points are there.thankyou for sharing a good one.
ReplyDeleteJMeter Training in Chennai
JMeter Training Institute in Chennai
JMeter Certification
Appium Training in Chennai
Best Appium Training institute in Chennai
Appium Training in Anna Nagar
JMeter Training in Chennai
JMeter Training
Very helpful article, Thank you for posting.
ReplyDeleteI have a question, Is there any possible way to update List View describe result using httpreq or metadata api.
This comment has been removed by the author.
ReplyDeleteI'm positive you might be like me, you may have additionally noticed many images displayed which have been taken by a mess of photographers, all with numerous imagery of what they prefer to take photos of. All hoping it's going to attraction to you so you'll take it house and place their creation in your wall to exhibit to others. If you want to learn more about this topic, then please visit here
ReplyDeleteEarlier than discussing the differing kinds of applications in addition to what they provide and to whom, it might be finest to begin with a primer on picture graphics and format. If you want to learn more about this topic please visit https://onlineconvertfree.com
ReplyDeleteawesome article,the content has very informative ideas, waiting for the next update...
ReplyDeletecore java training in chennai
Best core java Training in Chennai
core java course
core java training in Velachery
core java training in Tambaram
C C++ Training in Chennai
javascript training in chennai
Hibernate Training in Chennai
expost records first view thanks for sharing this page..i really need some more details..
ReplyDeleteAngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery
https://bayanlarsitesi.com/
ReplyDeleteManisa
Denizli
Malatya
Çankırı
QXPJOP
https://bayanlarsitesi.com/
ReplyDeleteEskişehir
Erzincan
Ardahan
Erzurum
Z7XF
show
ReplyDeletewhatsapp ucretli show
R5XP
Bolu Lojistik
ReplyDeleteMardin Lojistik
Kocaeli Lojistik
Diyarbakır Lojistik
İstanbul Lojistik
JO6SRZ
F8DF7
ReplyDeleteRize Lojistik
Artvin Lojistik
Gümüşhane Parça Eşya Taşıma
Ağrı Parça Eşya Taşıma
Rize Parça Eşya Taşıma
5C31A
ReplyDeleteHakkari Şehirler Arası Nakliyat
Kilis Parça Eşya Taşıma
Artvin Şehirler Arası Nakliyat
Pursaklar Fayans Ustası
Bilecik Şehir İçi Nakliyat
Referans Kimliği Nedir
Eskişehir Şehir İçi Nakliyat
Erzurum Şehirler Arası Nakliyat
Samsun Evden Eve Nakliyat
E25EF
ReplyDeleteKütahya Şehirler Arası Nakliyat
Kırşehir Şehir İçi Nakliyat
Ardahan Parça Eşya Taşıma
Ordu Evden Eve Nakliyat
Sincan Boya Ustası
Çerkezköy Televizyon Tamircisi
Tunceli Şehirler Arası Nakliyat
Antep Parça Eşya Taşıma
Antalya Şehirler Arası Nakliyat
CBB65
ReplyDeleteArdahan Parça Eşya Taşıma
Qlc Coin Hangi Borsada
Adana Lojistik
Osmo Coin Hangi Borsada
Gümüşhane Şehirler Arası Nakliyat
Lovely Coin Hangi Borsada
Burdur Şehir İçi Nakliyat
Silivri Duşa Kabin Tamiri
Silivri Parke Ustası
C9EBB
ReplyDeleteElazığ Bedava Sohbet Odaları
Çankırı Goruntulu Sohbet
kadınlarla sohbet et
hakkari en iyi sesli sohbet uygulamaları
uşak sesli sohbet mobil
çorum yabancı görüntülü sohbet
samsun canli sohbet chat
sinop mobil sesli sohbet
bursa canli sohbet bedava
C1BB0
ReplyDeletereferans kimliği nedir
binance referans kodu
biberiye sabunu
bibox
bybit
mexc
referans kodu binance
kripto ne demek
mexc
8E154
ReplyDeleteokex
btcturk
referans kimliği
en düşük komisyonlu kripto borsası
cointiger
bitget
bybit
https://toptansatinal.com/
poloniex
E275E
ReplyDeletetürk kripto telegram grupları
bitexen
bingx
binance ne demek
gate io
vindax
btcturk
gate io
bingx
1CCBF
ReplyDeletetelegram kripto para
binance
cointiger
kraken
bitexen
güvenilir kripto para siteleri
bybit
probit
kucoin
516D4
ReplyDeleteen güvenilir kripto borsası
bitcoin ne zaman çıktı
en düşük komisyonlu kripto borsası
ilk kripto borsası
telegram kripto para grupları
toptan sabun
mexc
bitexen
btcturk
D6CEA
ReplyDeleteSeptember 2024 Calendar
binance
mercatox
canlı sohbet ücretsiz
kripto ne demek
okex
telegram en iyi kripto grupları
btcturk
bybit
184E4
ReplyDeletegörüntülü show uygulamaları
A2C91
ReplyDeletewhatsapp görüntülü şov
4F5C2
ReplyDeletewhatsapp görüntülü show
1FFA4
ReplyDeletegörüntülü şov
52120
ReplyDeletegörüntülü show
648C4
ReplyDeletegörüntülü şov
AC922
ReplyDeletewhatsapp görüntülü show güvenilir
1259EE2704
ReplyDeletelay era
cialis
geciktirici
fx15
lifta
performans arttırıcı
themra macun
maxman
novagra
91A9C29365
ReplyDeletegeciktirici
cialis
kaldırıcı
themra macun
performans arttırıcı
yapay kızlık zarı
sildegra
bufalo içecek
green temptation
BC81ADD8E5
ReplyDeleteviga
ücretli şov
şov
novagra
ereksiyon hapı
görüntülü şov whatsapp numarası
telegram görüntülü şov
kamagra
sertleştirici
0AAA05EDAA
ReplyDeletewhatsapp ücretli show
cam şov
sildegra
ereksiyon hapı
bufalo çikolata
degra
vigrande
maxman
whatsapp görüntülü şov
014105A5F6
ReplyDeleteviagra
kamagra
ücretli show
vega
skype show
sertleştirici
kaldırıcı
novagra
performans arttırıcı
D7B5F07458
ReplyDeleteviga
themra macun
degra
vega
bayan azdırıcı damla
cialis
telegram görüntülü şov
ücretli şov
whatsapp görüntülü şov
1D4364EB90
ReplyDeletenovagra hap
viagra
kaldırıcı hap
yapay kızlık zarı
delay
cobra vega
degra 100 mg
telegram görüntülü şov
ücretli show
ECAF020FF9
ReplyDeletedelay
sildegra
stag
ücretli şov
cam şov
whatsapp görüntülü şov
ücretli show
viga
novagra hap
9559AE568E
ReplyDeletecialis
whatsapp ücretli show
maxman
sertleştirici
performans arttırıcı
novagra hap
vega
geciktirici jel
cobra vega
DD3099F6DC
ReplyDeletebayan azdırıcı damla
görüntülü show
themra macun
telegram show
canli web cam show
green temptation
cam şov
viagra
kamagra hap
07020BBA4A
ReplyDeletetwitter takipçi
E3B1CFFD45
ReplyDeleteAnadoluslot
Anadoluslot
Anadoluslot Güncel Adres
Anadoluslot Giriş
Trwin Güncel Adres
Trwin Güncel Giriş Adresi
Trwin Güncel Adres
Trwin Giriş
Trwin