Skip to main content
Aron Schor (The WNET Group) a posé une question dans #Reporting

Hi, this query works in SOQL but I am hoping to do create a report type.  I am not having much luck.  Any idea if I can create a report type to handle these objects? 

 

SELECT 

LinkedEntity.Name, 

ContentDocument.Title, 

ContentDocument.LatestPublishedVersion.TextPreview 

FROM ContentDocumentLink 

WHERE LinkedEntity.Type = 'Contact'  

 

These report types show no data: "File and Content Report" and "Content Report" 

 

 

Thanks, Aron! 

 

#Reporting  #SOQL  #Notes & Attachments

3 réponses
  1. Aujourd’hui, à 05:00

     Hii @Aron Schor

    Unfortunately, you can’t build a report type on this. Enhanced Notes and Files are stored in ContentNote, ContentDocument and ContentDocumentLink, and Salesforce doesn’t expose these objects in the custom report type builder. That’s why your SOQL works but a report type doesn’t. 

    “File and Content Report” and “Content Report” are for Salesforce CRM Content libraries, not notes attached to records, so they show no data. 

    Options: 

    1. Mirror the notes into a custom object. Create something like Note_Summary__c with a lookup to Contact and fields for the title and preview text. Populate it with an Apex trigger on ContentDocumentLink or a scheduled Apex job, then build a standard custom report type on it.
    2. Export the data. If you only need a spreadsheet, run your query in Data Loader or Workbench.
    3. Use classic Notes. If you use the old Note object instead of Enhanced Notes, the standard “Contacts with Notes and Attachments” report type works.

     

    Also, TextPreview only returns a short preview (about the first 100 characters). To get the full note body, you need Apex or the API. 

      

    Hope this helps!  

    If it answers your question, please mark it as the best answer. 

     

0/9000