This article introduces the procedure for outputting images of Image function fields in Salesforce to documents in Office File Creator.
*This feature is available in Office File Creator Pro.
Output Sample
As an example, output the image of a static resource displayed with the Image function on a contract object to a Word document.
Contract record detail screen
SLA_Image image is displayed according to the SLA value.
SLA: Gold
SLA: Silver
SLA: Bronze
Create a formula field of the Image function.
Upload the image to static resources
Upload image files to the static resource from the settings.
*Only MIME type "image/xxx" in the static resource will output images. Please upload image files directly to the static resource. Image files in ZIP files are not supported by the application.
Create formula fields
Create a custom formula field.
Data type: formula(The return value is text)
e.g. SLA_Image__c
To display an image of a static resource, create the formula using IMAGE function in the following format. The height and width are the display size of the record screen and can be omitted.
IMAGE( "/resource/Static Resource name", "name", height, width)
e.g. IMAGE( "/resource/Image_SLA_Gold","Gold")
This time, the image is displayed according to the value of the Picklist field "SLA__c", so create a formula that branches with CASE.
CASE( SLA__c,
"Gold", IMAGE( "/resource/Image_SLA_Gold","Gold"),
"Silver", IMAGE( "/resource/Image_SLA_Silver", "Silver"),
"Bronze", IMAGE( "/resource/Image_SLA_Bronze", "Bronze"),
null)
OFC Settings
Merge Fields Settings
Merge fields for images are the same as other fields, with {!Object API Name.Field API Name}, or in the case of a child object, {!Childrelation Name.Field API Name} for child objects. This time, output the image of the Image function formula field SLA_Image__c.
{!Contract.SLA_Image__c}
OFC_Template Record Settings
Enter the image field and size settings. Size settings are set for the primary object, child objects, and attachments, all in the OFC_Template record.
(Pro) Image
Image Field API Name: Enter the Image Field API Name. e.g. SLA_Image__c
(Word/PDF) Image Size in Table Cell (%): If left blank, the default of 85% is applied. This time, leave blank since using the default.
(Word/PDF) Image Default Height (mm): This is used when the row height of a table is not specified or for images outside of table cells. If left blank, the default of approximately 50 mm is applied. This time, the row height of the table is specified in Word, so it is not subject to setting.
Memo
For sizing details, see Output Images of Rich Text Fields in Salesforce to documents.
Output File
After the test output, create a custom button.
Output Sample
Limitations/Considerations
Refer to Output Images for limitations and considerations when outputting images.