Skip to main content

I have a list of Contacts and I’d like to be able to access their latest attachment via the list view.


(of course I think if I can make a URL on the contact detail itself I can also access this from the list view… maybe using a formula field? This would be aweseome)


When clicking on this link or row action, it would be great if we can either, open a new tab with the latest document, do a pop up, or even better a scroll over view. Really anything will suffice.


I found this online which allows me to create a button and utilize JavaScript. https://success.salesforce.com/answers?id=90630000000hQ6jAAE


This is great on the Contacts detail record, but again I am trying to do this from a list view.


I’m guessing it is as easy as having a URL redirect to this.


<A Href = “/servlet/servlet.FileDownload?file={{{Id}}}”; Target = “_Blank”> {{Name}}


Or setting up a pop up



BUT… how I get the most recent attachment ID from this Contact… that is a bit confusing because I can’t really traverse the model from the list view.

In your models - fields properties you will notice a “child relationships” section. This is where you add the attachment relationship fields to your model. You can also specify filters on the child data, sort order and number of rows returned. I’d reccomend order by createdDate DESC and only show one record.


Then you drag that child relationship item from the field list down into your table and it acts like a template component, where you define a custom label and use syntax that looks like this.


<A Href = “/servlet/servlet.FileDownload?file={{{Id}}}”; Target = “_Blank”> {{Name}}


This will do what you are looking for.


Rob, Awesome.  I don’t think I have messed with the child relationships yet.  I am going to find some new uses now!  Everything worked, but I did need to put {{Title}} instead of {{Name}}.  When I did {{Name}} nothing happened.