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
trsmithtrsmith 

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! 

Message Edited by trsmith on 02-22-2009 07:42 AM
Message Edited by trsmith on 02-22-2009 07:44 AM
Message Edited by trsmith on 02-22-2009 08:06 AM
Message Edited by trsmith on 02-22-2009 08:07 AM
Best Answer chosen by Admin (Salesforce Developers) 
trsmithtrsmith
This problem seems to have miraculously fixed itself. I guess I'll just have to give it up to bug fixes after the most recent rollout. Hopefully the problem doesn't rear its head again come net release.

All Answers

trsmithtrsmith
Just trying again, has this problem shown up for anyone else?
trsmithtrsmith
is anyone else having this problem? I've had this happen on two customer org's now. This is very frustrating. We need to be able to use field values in the attached pdf filename on VF email templates.
pmozz01pmozz01
Have you tried using the same name as the quote?  I am using the most recent quote and quote line items from the AppExchange and it names the pdf file the same name as the quote
trsmithtrsmith

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. 

pmozz01pmozz01

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}">

trsmithtrsmith
This problem seems to have miraculously fixed itself. I guess I'll just have to give it up to bug fixes after the most recent rollout. Hopefully the problem doesn't rear its head again come net release.
This was selected as the best answer
Jha dilipJha dilip
Hi Team,

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