Output images of Image function fields to documents in Salesforce

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.

 

 

Create formula fields

Create a custom formula field.

Data type: formulaThe 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

Set image size settings. Size settings are set in OFC_Template for all the master object, child objects, and attachments.

 

(Pro) Image

(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.

 

After the test output, create a custom button.

 

 

Output File

Output Sample

 

 

Limitations/Considerations

Refer to Output Images for limitations and considerations when outputting images.

 

 

 

 

 

タイトルとURLをコピーしました