+ Start a Discussion
lz123lz123 

How to retrieve article attachment link?


I'm creating a customized salesforce page.

I would like to display Article FAQ attachment field on the page. If a user clicks on the attachment link, they can download the attachment.

 

I am able to access the attachment name according to this soql query, but I do not know how to get the actual  attachment link?

 

 

 

Select UrlName, Title, Summary, Question__c, Answer__c , Attachment_File__Body__s, Attachment_File__ContentType__s, Attachment_File__Name__s,   KnowledgeArticleId,ArticleType, ArticleNumber, LastModifiedDate From FAQ__kav where id = 'ka2Q00000008TU1IAM'

Any help would be greatly appreciated!!!

 

Thanks!!!

Best Answer chosen by Admin (Salesforce Developers) 
lz123lz123

I actually found the solution in case anyone is interested. I redirect the link for article attachment link as follows.

 

 <a href="/servlet/fileField?entityId={!FAQ__kav.Id}&field=Attachment_File__Body__s">{!FAQ__kav.Attachment_File__Name__s}</a>

 

All Answers

lz123lz123

I actually found the solution in case anyone is interested. I redirect the link for article attachment link as follows.

 

 <a href="/servlet/fileField?entityId={!FAQ__kav.Id}&field=Attachment_File__Body__s">{!FAQ__kav.Attachment_File__Name__s}</a>

 

This was selected as the best answer
zainul abedin khanzainul abedin khan
Hi, Thank you very much lz123 for your reply. It was very helpful to me. However, could you please explain what's happening and how you found the solution?
RaaaaaaJRaaaaaaJ
cloud you please share code 
i am having same requirement
Any help would be greatly appreciated