You need to sign in to do that
Don't have an account?
How to Query a File uploaded to Article through SFDC in Visual force using SOQL
Hi,
I extended the Article Type object and Added a Field of type File. Filed name is Files_to_attach__c. I trield to Access the Field in SOQL as Follows
Select b.Files_to_attach__c,b.Author__c,b.ArticleNumber,b.Title,b.status__c from Book__kav b
where PublishStatus = 'Online' and Id =:ApexPages.currentPage().getParameters().get('id') ;
But I got an Error :
Error: ArticleDetailsController Compile Error: No such column 'Files_to_attach__c' on entity 'Book__kav'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. at line 101 column 31.
After that I found the File Field has subfields Files_to_attach__Name__s (type is Text)
Files_to_attach__ContentType__s (type is picklist)
Files_to_attach__Length__s (type Number 9,0)
Files_to_attach__Body__s (type Text area).
SOQL allowing to query the subfields . I want to know How to retrieve the File id for the Field Files_to_attach__Name__s so that when Im clicking on the File name I can down load the File.
Please share with me if any other approaches are available.
Thanks in Advance.
Regards
SureshKumar.C
I have a similar requirement too in order to retrieve the attachments from Article ? Were you able to get any answer for your query?
Hi,
If you want to access file field from a VF page, the syntax is not obvious but documented ;).
https://help.salesforce.com/apex/HTViewHelpDoc?id=knowledge_article_templates_custom.htm&language=en
If your article type has a File field, you can allow users to download the field's content. In the following example, the article type is Offer, the name of the File field is my_file, and the text that appears as a link is Click me: