Output lists and images of attachment 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 attached to the Opportunity record.
- Output images of files attached 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.
Related files of the master object
File Object: {!ContentDocument.Field API Name}
Memo & Attached Object: {!Attachment.Field API Name}
Related files of the child object
File Object: {!(Childrelationship Name)ContentDocument.Field API Name}
Memo & Attached Object: {!(Childrelationship Name)Attachment.Field API Name }
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.
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.
Create an OFC_Child Object Option record.
Information
Name: Enter any name. e.g. File
Child Relationship Name: For related files of the master object, enter "ContentDocument" or "Attachment". For related files of the child object, enter in the format "(Childrelation Name)ContentDocument" 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) Filter Criteria (ContentDocument/Attachment)
Set the conditions for related files.
FilterCriteria Field API Name: Enter the field API name for filtering ContentVersion or Attachment records.
(File) FilterCriteria Operator: Select the operator for filtering ContentVersion or Attachment records.
(File) FilterCriteria Value: Enter the value for filtering ContentVersion or Attachment 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.
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.
Reference
Output attached images in Salesforce to documents