0

I created a DLRS (Declarative Lookup Roll-up Summary) on the Opportunity that counts how many Files are related to it. However, the count gives me both the Files+Notes and I only want the File count, without Notes. Any idea how to achieve this?

enter image description here

Example: The count says 5+1=6. I only need the 5 files.

enter image description here

I check the object ContentDocumentLink and dont find a way to distinguish between Files and Notes. Any idea?


Update:

Using @David Cheng idea I tried to use as the Relationship Criteria ContentDocument.FileType = 'PDF' but it looks like you can not traverse across objects in DLRS.

The query works in Workbench but not in DLRS.

Workbench SELECT count() FROM ContentDocumentLink WHERE LinkedEntityId = '0063l00000hLMbhAAG' AND ContentDocument.FileType = 'PDF'

DLRS enter image description here

6
  • You should be able to use standard dot-notation to reference a related ContentDocument field in the Relationship Criteria field, e.g. ContentDocument.FileType != [whatever values ContentNote uses]. Aug 26, 2022 at 14:38
  • @DavidCheng I just tried to add the Relationship Criteria ContentDocument.FileType = 'PDF' but get and error. Looks like you can traverse across objects on DLRS. See my updated question.
    – Lut
    Aug 26, 2022 at 16:02
  • PDF was just an example, you need to determine the correct data type for the FileType field, or use a different field for your criteria. Aug 26, 2022 at 16:03
  • I get what you mean, the challenge is not the FileType. ContentDocument.FileType != 'SNOTE' to exclude notes, or ContentDocument.FileType = 'PDF' to only count PDF. The challenge is not been able to query across object on the DLRS Relationship Criteria.
    – Lut
    Aug 26, 2022 at 16:07

0

You must log in to answer this question.