Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 1.74 KB

README.md

File metadata and controls

41 lines (33 loc) · 1.74 KB

Export From ListView

Deploy to Salesforce

This simple project allows you to Export records into excel sheet directly from Standard List view of any objects.Find more details in my blog check here

Screenshot

![img](/images/ExportToExcel.png)

Export to Excel button

To add the Export to excel button follow the below setps, below 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
//Getting List Name 
var listview = document.getElementsByName('fcf')[0]; 
var listName = listview.options[listview.selectedIndex].text; 
//Getting List Id 
var listId = document.getElementsByName("fcf")[0].value; 
var ObjectName = 'Account'; //Action : Enter the Object API Name
//Passing ListId,ObjectName and ListName to Visualforce page 
window.open("apex/exportStandardListView?Object="+ObjectName+"&listid="+listId+"&listName="+listName,"myWindow");

Remote Site settings

  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