-1

Referring below post:

https://developer.salesforce.com/forums/?id=906F00000009CyyIAE

I came to know I can display knowledge articles like attachment like this in classic

<apex:outputLink value="/servlet/fileField?entityId= {!FAQ__kav.Id}&field=Attachment_1__Body__s">
<apex:outputfield value="{!FAQ__kav.Attachment_1__Name__s}"/>
</apex:outputLink>

How can I do it Lightning Knowledge. How can I display attachments in Lightning.

I read below documents:

https://help.salesforce.com/articleView?id=knowledge_compare_classic_lightning.htm&type=5

For Lightning Knowledge:

Files are stored in the standard Files Object and attached in the files related list

i Need to use salesforce files(that content version).how can I filter it based on knowledge Id

1
  • Yes but I need to filter it based on Knowledge Id how can I do that? – Annappa Jan 28 '19 at 10:07
1

You have to query ContentDocumentLink table for ContentDocumentId by passing your knowledge id as LinkedEntityId

eg:

SELECT ContentDocumentId FROM ContentDocumentLink where LinkedEntityId ='ka01l0000008SflAAE'

And the url to view it will be

https://instanceurl.salesforce.com/lightning/r/ContentDocument/ContentDocumentId/view

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.