You need to sign in to do that
Don't have an account?
Sjaleel
Attachment preview
Dear Developers,
Is it possible to do a preview of the attachment file?
I want to have preview of the VF page am rendering as PDF and sending it as an attachment in email, is it possible? If so then how?
Regards and Thanks in advance
You should be able to simply open a popup window and pass the URL of the PDF.
How are you firing the email send? Does the user click a button on another page?
The email is sent from a VF page " MaintenanceReserveInvoice" where the user enters the address and clicks the button , the pdf attachment page is another VF page "invoicegenerator"
Thanks and regards...
You should then be able to specify an onclick javascript function that opens the invoicegenerator page in a popup window.
Can 2 windows be opened at the same time on a mouse click?
The page where the user sets the email add and the page were the PDF is?
Thanks and Regards
While I can't see any reason why that wouldn't work, its not something I've done myself so I can't say for sure that it would.
How would the script likely be?
navigateToUrl('/apex/MaintenanceReserveInvoice?id={!Utilization_Report__c.Id}')
This would open the page were the user inputs the add, how can the other window the PDF page included? Any help would be appreciated
Thanks and regards
Could it be done using the Visualforce Component, is there a way it can used with in a controller?
A controller won't be able to open a window on the browser, that has to be done client side.
If you are using a commandbutton, then the following snippet opens a window as well as submitting the form:
How's the address to the pdf page passed onto onclick, the apex page address with the ID?
something like this
"apex/invoicegenerator?id="
Thanks and regards
P.S Sorry if my question is silly, but I still need to learn ^__^
In the commandbutton example, the URL is highlighted in red:
So in your case you'd have something like:
Id value Utilization_Report__c.id is not valid for the Utilization_Report__c standard controller
This is the error that's coming up when trying to access the ID! Could it be that because there is no ID field in the Utilization_Report__c object?
Thanks and regards
That looks like you have used the text literal rather than merge field.
Does your command button look like this:
If so, change to:
<apex:commandButton value="Preview" onclick="window.open('/apex/InvoiceGenerator?id={!UR.id}', 'Popup', 'height=500,width=600,left=100,top=100,resizable=no, scrollbars=yes,toolbar=no,status=no');" />
I found out that there was a space between the equal sign and the merge field that generates a different ID each time the preview button was clicked, I guess I will have be more alret and take care of those minute details..
Thanks alot for the great help and helping me thru
Regards
SAjaleel
Glad to see that you got there.