You need to sign in to do that
Don't have an account?
Praenei
Create csv file from Quick Action - how to close VFP?
Hi.
This shouldn't be difficult but not found a way to solve it.
The user requirement is for a quick action button to appear on one of our custom objects. If user clicks it then a csv file will be generated containing the email addresses of contacts linked to the custom object. The problem I have is that after the user clicks the quick action button the csv file is generated but the VFP (blank screen) stays open. I ideally want this to disappear.
Controller (ExportCaseReportEmailsCtrl)
Thanks
This shouldn't be difficult but not found a way to solve it.
The user requirement is for a quick action button to appear on one of our custom objects. If user clicks it then a csv file will be generated containing the email addresses of contacts linked to the custom object. The problem I have is that after the user clicks the quick action button the csv file is generated but the VFP (blank screen) stays open. I ideally want this to disappear.
Controller (ExportCaseReportEmailsCtrl)
public with sharing class ExportCaseReportEmailsCtrl { public List<case_contact__c> contactDetails {get; set;} public ExportCaseReportEmailsCtrl(ApexPages.StandardController controller) { getContactDetails(); } public PageReference getContactDetails(){ contactDetails = [select id, contact__r.name, contact__r.account.name, contact__r.email from case_contact__c where Case_Number__c in (select case_number__c from case_report_Code__c where report_code__r.id = :ApexPages.currentPage().getParameters().get('id') ) and contact__r.email != null]; return new PageReference(''); } }VFP :-
<apex:page standardController="report_code__c" extensions="ExportCaseReportEmailsCtrl" cache="true" contentType="text/csv#reportCodeEmails.csv;charset=utf8" language="en-US">"Name2","Client","Email" <apex:repeat value="{!contactDetails}" var="a"> "{!a.contact__r.name}","{!a.contact__r.account.name}","{!a.contact__r.email}" </apex:repeat> </apex:page>Screenshot of VFP remaining open
Thanks
LC component:- LC controller :-
The rest of the code remains the same.
Hope it helps someone else in the future.
All Answers
See example here
LC component:- LC controller :-
The rest of the code remains the same.
Hope it helps someone else in the future.