Override Attachment Object?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Is there a way to override the Attachment View action?

I created the skuid page, the page assignment and the VF wrapper. But there doesn't seem to be a way to tell salesforce to use my VF page instead of the standard attachment detail page. I've got to avoid sending folks into the scary world of plain SFDC.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
This is probably not a satisfactory answer,  but you can work to have all your attachment links go directly to your skuid page,  rather than going to the salesforce record ID.  If you are trying to avoid the Salesforce UI entirely - then probably everything is in your control.  We also often don't ever let users see the attachment detail page - we surface all the necessary data into an attachemnts table - and override all links so they go directly to the file itself using somthing like "/servlet/servlet.FileDownload?file={{{Id}}}"
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Makes sense. Thanks, Rob.
Photo of Jason C

Jason C

  • 682 Points 500 badge 2x thumb
Hi Rob,

I'm trying to accomplish the same thing but I'm still getting the default Salesforce file detail page when I click on the link instead of the file download. I have a template field with the following:

<a href="/servlet/servlet.FileDownload?file={{{Id}}}" target="_blank">{{Name}}</a>

Is there somewhere else I need to override the link behavior?? 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
The Name field needs to be wrapped in {{{Triple Braces}}}.    When you wrap it in double braces,  the link is still active. You just want the data in this case so that the link is provided by the a href.  That is provided by triple braces. 
(Edited)
Photo of Jason C

Jason C

  • 682 Points 500 badge 2x thumb
Thanks Rob, Completely missed that.