You need to sign in to do that
Don't have an account?
filename in visualforce email template attachment not allowing field value in it
I have a visualforce email template that we use to send out quotes. It attaches a PDF of the quote to the email template in the format "Quote-[quotenumber].pdf" where quotenumer is an auto-generated number in a custom field. In the visualforce template, the filename looks like this:
<messaging:attachment renderas="pdf" filename="Quote-{!relatedTo.Opp_Quote_Num__c}">
Prior to the upgrade to '09, this worked just fine. The pdf would attach with a name like "Quote-09775.pdf". But now the file gets attached as just "Quote-.pdf" without any changes having been made to the template and I can't seem to figure out a fix. Is this a bug? Has anyone else seen this?
Thanks in advance for any help!
All Answers
Hi pmozz01,
I'm not sure what you mean, exactly. In my visualforce email template, I have the attachment filename set as below:
<messaging:attachment renderas="pdf" filename="Quote-{!relatedTo.Opp_Quote_Num__c}">
Prior to the Spring '09 update, this worked fine. It would attach the pdf quote as "Quote-001.pdf" or "Quote-002.pdf", etc, where the number in the filename was the value from the Opp_Quote_Num__c field on the opportunity which was just an auto-number custom field.
After the Spring '09 update, however, quotes started attaching to emails as just "Quote-.pdf"
So it appears that where the filename value for message attachments used to allow for dynamic field values in it, it no longer does. I can only assume that this is a bug since it used to work and no longer does without any intervention on our part.
I just checked it out again in my instance. If I try to create the email with the pdf quote from the opportunity, then it does not name the quote correctly. If I create it from the quote itself, everything works fine. This is how my VF email template references it:
<messaging:attachment renderAs="pdf" filename="{!relatedTo.name}">
we are facing the similar issue when language is bulgaria or some local one then we are not getting the value in pdf heading..any suggestion.it shows blank