You need to sign in to do that
Don't have an account?

Get attachment id dynamically
Hi,
i am having an URL field on account object.
For now i hard coded the value as https://c.na14.content.force.com/servlet/servlet.FileDownload?file=00Pd000000JHoPF
(I am getting image whose name starts with or contains 'bill' in its name from notes and attachment section and using that.)
I would like to make it dynamic.
My idea is: to create a new text field on account object which holds the attachmentid and create a formula fields which joins URL value and attachment id .
Or else ho can i use it??
I need to use this field /URL in visualforce template.So its required to generate that field in this format:
'https://c.na14.content.force.com/servlet/servlet.FileDownload?file= +attachmentid'
Please help.!!!!!!!
i am having an URL field on account object.
For now i hard coded the value as https://c.na14.content.force.com/servlet/servlet.FileDownload?file=00Pd000000JHoPF
(I am getting image whose name starts with or contains 'bill' in its name from notes and attachment section and using that.)
I would like to make it dynamic.
My idea is: to create a new text field on account object which holds the attachmentid and create a formula fields which joins URL value and attachment id .
Or else ho can i use it??
I need to use this field /URL in visualforce template.So its required to generate that field in this format:
'https://c.na14.content.force.com/servlet/servlet.FileDownload?file= +attachmentid'
Please help.!!!!!!!
My vf email template doesnt have component reference and class.
Please suggest a way!!!
https://c.ap1.content.force.com/servlet/servlet.FileDownload?file=
now after equal to give {!relatedto.id}
Your vf template code shall look something like this
I have other merge fields which i had to show in my template.Those are related to other object.
Tis is just a part of template.
so i cant use https://c.ap1.content.force.com/servlet/servlet.FileDownload?file=
{!relatedto.id}This is how my template is:
<messaging:emailTemplate subject="Your report" recipientType="User" relatedToType="Customobject__c" >
<messaging:attachment renderAs="pdf" filename="{!relatedTo.name}">
<table border="0" cellspacing="0" cellpadding="0" width="150%" id="table1">
<tr>
<td align="left"><font face="Arial" >
<b>Expense Report for {!relatedTo.Name} </b></font><br/>
</td>
</tr>
</table>
<hr/>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>
<td>
Report
</td>
</tr>
</table>
<table style="width:100%">
<tr>
<td>
<font face="Arial"> Report Name {!relatedto.Name} <br/><br/></font>
</td>
Picture you had requested <td> <img src='{!relatedto.URL_Picture__c}'/><br/><br/> (this is how i am using now.URL_Picture__c is the field on my custom object which holds the URL of image.)
For now i hardcoded the value in record so able to display image content in template.
Please suggest a way.I need thi sASAP
Thank you.