function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kayal PKayal P 

Custom Export Button

Hi all,

 

Is it possible to create a custom button implementing the "Export Details" functionality in any page? To be in detail, in my Contact list view which lists contacts based on the Selected View (All Contacts, My Contacts, Recently Viewed..), is it possible to have a custom "Export" button which will export the selected contacts to local Excel file or other text file? Basically I just want to create a custom "Export" button to export the selected contact details to my local machine. Any suggestion would be of really a great help guys..!!

 

-Kayal

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
JitendraJitendra

Hi,

You can achieve this with the help of Custom button, Custom Controller Extension (StandardSetController ) and Visualforce Page.

 

Create a custom Button on List View. When user clicks on that button, navigate to your VF page. you can set the output type of the VF page.

 

Please read,

http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_standardsetcontroller.htm

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=Template%2FSplash.htm|StartTopic=Content%2FTemplate%2FSplash.htm|SkinName=webhelp

 

All Answers

JitendraJitendra

Hi,

You can achieve this with the help of Custom button, Custom Controller Extension (StandardSetController ) and Visualforce Page.

 

Create a custom Button on List View. When user clicks on that button, navigate to your VF page. you can set the output type of the VF page.

 

Please read,

http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_standardsetcontroller.htm

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=Template%2FSplash.htm|StartTopic=Content%2FTemplate%2FSplash.htm|SkinName=webhelp

 

This was selected as the best answer
Kayal PKayal P

Thanks, Jitendra. It just worked and got my solution. Thanks again!!

 

-Kayal

Kayal PKayal P

Jitendra,

 

I have created a custom object. With the new custom object, with the records created, i have implemented the custom "Ëxport" button. But when i tried linking the visualforce page with the custom "Export" button, i couldn't relate the created VF Page since nothing is listed in the "Content" dropdown. I read in other posts like "You need to make sure that your Visualforce page uses the standardcontroller of the standard page/object you are placing your custom button on". So its not possible to create a custom button which will open up a VF page that uses my custom object?

 

-Kayal

JitendraJitendra

Hi Kayal,

 

Everything you want can be done using Controller extension.so use Standard Controller attribute and then write your complete code in Controller extension then only you can relate your VF page.

Kayal PKayal P

Thanks again Jitendra...but its not possible to create a "List Button" with this implementation? because i can see the VF page listed in the Content dropdown for "Detail Page Link" & "Detail Page Button" but not for "List Button"...is that i'm missing out something??

 

-Kayal

Kayal PKayal P

It worked by setting recordSetVar attribute in my VF Page.

 

-Kayal