Output Related Files (List/Images)

Output lists and images of related files (ContentDocument/Attachment) of the master object and child objects.

*This feature is available in Office File Creator Pro.

Overview

Examples of Use

  • Output a list of files related to the Opportunity record.
  • Output images of files related to the Opportunity record.

 

Required settings

  • Merge Fields Settings
  • OFC_Template Record Settings (image size settings)
  • OFC_Child Object Option Record Settings (output options, child object attachment files above 3 levels, image output)

 

Merge Fields Settings

Set the merge field in the template file in the following format.

Files (ContentDocument)

Master Object: {!ContentDocument.Field API Name}

Child Object: {!(Childrelationship Name)ContentDocument.Field API Name}

 

Files (ContentDocumentLink)

ContentDocumentLink is also available. ContentDocumentLink can be used to output the field values of the parent record of a file. Used for grouping output by child record value when outputting files of child records, etc. Set a cross-object formula for merge fields.

ContentDocument fields

Master Object: {!ContentDocumentLink.ContentDocument.Field API Name}

Child Object: {!(Childrelationship Name)ContentDocumentLink.ContentDocument.Field API Name}

*The Field API Name is the ContentDocument field.

 

File's parent record fields

Master Object: {!ContentDocumentLink.LinkedEntity.Field API Name}

Child Object: {!(Childrelationship Name)ContentDocumentLink.LinkedEntity.Field API Name}

*The Field API Name is the file's parent record field.

 

Attachments (Attachment)

Master Object: {! Attachment.Field API Name}

Child Object: {!(Childrelationship Name)Attachment.Field API Name}

 

Image Output

When outputting an image, set to "Id" for the Field API Name.

Master Object Example: {!ContentDocument.Id}

Child Object Example: {!(OpportunityLineItems)ContentDocument.Id}

 

OFC_Child Object Option Record Settings

If image output and option settings are required, an OFC_Child Object Option Record must be created. Otherwise, no records need to be created.

 

Example of when settings are required

  • Specify output conditions and sorting of related files.
  • Specify output conditions for child objects when outputting related files of child objects.
  • Output related files of child objects at three or more levels.
  • Output images of related files.
  • Group output.

 

Create an OFC_Child Object Option record.

Information

Name: Enter any name. e.g. Files

Child Relationship Name: For related files of the master object, enter "ContentDocument", "ContentDocumentLink", or "Attachment". For related files of the child object, enter in the format "(Childrelation Name)ContentDocument", "(Childrelation Name)ContentDocumentLink", or "(Childrelation Name)Attachment".

Example of attachment files of master objects: ContentDocument

 

Example of attachment files of child objects: (OpportunityLineItems)ContentDocument

 

*For output of child objects at three or more levels, please refer to the output of child records at three or more levels.

 

(Pro) File Filter Criteria

Set the conditions for related files.

(File) FilterCriteria Field API Name: Enter the field API name for filtering ContentDocument, ContentDocumentLink, or Attachment records.

(File) FilterCriteria Operator: Select the operator for filtering records.

(File) FilterCriteria Value: Enter the value for filtering records.

(File) SOQL (Where): For multiple conditions, enter a SOQL condition clause.

 

*For filter conditions of child records, refer to the Filter Output Conditions for Child Records.

*The SOQL setting is for developers and advanced users who require knowledge of SOQL and is not covered by inquiry support.

 

Sort Order

Set the sort order of the related files.

 

(Pro) Image

As with the merge field, enter "Id" for the "Image Field API Name".

Image Field API Name: Id

 

Memo

In principle, the image field for the related file is Id, but any field in the ContentDocument or Attachment object can be specified as an image field. When outputting, items whose data type is Base64 are output as image data.

 

Limitations/Considerations

  • Refer to Output Images for limitations and considerations when outputting images.
  • The SOQL setting is for developers and advanced users who require knowledge of SOQL and is not covered by inquiry support.

 

Reference

Output attached images in Salesforce to documents

Output a list of files of Cases related to the Account, grouped by case number