Functions for Merge Fields

List of functions available for merge fields in Office File Creator.

Common

Function Description Merge Field OFC Version
Today Output today's date. {!Today()} Ver.2
Now Output the current date and time. {!Now()} Ver.2
Pagenumber Output page numbers of PDF. {!pagenumber()} All Version
Pagecount Output the total number of pages of PDF. {!pagecount()} All Version
ToLabel Output the display label name of the picklist and RecordType. Or output the translated value. {!Object API Name.ToLabel(Field API Name)} Ver.2

 

*ToLabel Function

The ToLabel function uses the toLabel function of the SELECT function when retrieving records by SOQL. The same merge fields cannot be retrieved with and without SOQL functions at the same time.

Reference: toLabel(fields)

 

Functions for child record

Merge Fields Format: {!Childrelationship Name.Number()}

 

Function Description Example of Merge Field OFC Version
Number Output sequential numbers in the child record output line. {!Number()}

{!OpportunityLineItems.Number()}

All Version
Blank Output blanks. Used to adjust block rows in child records. {!OpportunityLineItems.blank()} Ver.2

 

Aggregate Functions

Merge Fields Format: {!Childrelationship Name.Function(Field API Name)}

 

Function Description Merge Field OFC Version
Sum Returns the total sum of a numeric field. {!OpportunityLineItems.Sum(TotalPrice)} Ver.2
Count Returns the number of group rows. {!OpportunityLineItems.Count(Id)} Ver.2
Avg Returns the minimum value of a field. {!OpportunityLineItems.Avg(TotalPrice)} Ver.2
Min Returns the minimum value of a field. {!OpportunityLineItems.Min(TotalPrice)} Ver.2
Max Returns the maximum value of a field. {!OpportunityLineItems.Max(TotalPrice)} Ver.2

 

Memo

  • If the group field is a formula field, the aggregate function cannot be used.
  • Output the aggregate value of child records. Aggregate functions can only be used for child objects for which grouping has been set in the OFC_Child Object Option record.