Save PDF files by calling OFC actions in the record trigger flow. Only PDF file format is supported.
*This feature is available in Office File Creator Pro.
*This feature will be released on Dec 9, 2024.
How to call an action
- Calls the "OFC - Save as PDF" action.
- After the action is executed, values are returned such as isSuccess, errorMessage, etc. are returned.
- When an error occurs, error handling should be included, such as obtaining the return value of the isSuccess and errorMessage parameters to detect the error and notify the administrator by e-mail in the event of an error.
- Turn on saving of output logs to capture the details of errors.
From the Flow Actions, enter "OFC" in the search box and select “OFC - Save as PDF”.
Parameters
Variable Name | Setting details |
recordId | Record Id |
template | Template Api Name of the OFC_Template Record. |
save (file/att *default is file) | Set the file output method. The default is "file".
|
execution name | Set any execution name, which is stored in the “Execution Name” of the OFC_Log record.
Examples of Use
|
Return Values
Variable Name | Result Values |
isSuccess | Returns the success or error of the file output result.
|
errorMessage | If isSuccess is False, it returns the error content. |
filename | File name (with extension) |
fileNameWithoutExtension | File name (without extension) |
fileExtension | File extension |
contentDocumentId | If the parameter ″save″ is "file", it returns the record Id of the ContentDocument object. |
contentDocumentVesionId | If the parameter ″save″ is "file", it returns the record Id of the ContentVersion object. |
attachmentId | If the parameter ″save″ is "att", it returns the record Id of the ContentVersion object. |
log Id | Returns the OFC_Log record Id. Returns the result if "Save Logs" is checked on the OFC_Template record.
*Log saving feature is available in OFC Pro. |
How to Execute Record-Triggered Flow
Flow Execution Method
When to Run the Flow for Updated Records: Only when a record is updated to meet the condition requirements
Optimize the Flow for: Actions and Related Records
Trigger the Flow When
Trigger the Flow When | Run Immediately | Run Asynchronously | Scheduled Path
(batch size 1) |
A record is updated | ○ | ○ | ○ |
A record is created | × | ○ | ○ |
Execution Pattern
Execution Pattern | Run Immediately | Run Asynchronously | Scheduled Path
(batch size 1) |
Update Merge Fields | × | ○ | ○ |
Batch creation/update of multiple records | × | × | ○ |
Memo
When calling an OFC action when creating or updating multiple records in bulk, an error "The number of results does not match the number of interviews that were executed in a single bulk execution request." will occur. To create or update multiple records in a batch from a data loader or program, run the Scheduled Path with a batch size of 1.
Asynchronous
When updating a record before executing OFC and using the updated value for the merge field, separate the transactions for updating the record and executing OFC. If executed in the same transaction, the record value before the update is set to the merge field.
Check on "Include a Run Asynchronously path to access an external system after the original transaction for the triggering record is successfully committed" in "Optimize the Flow for".
Update the record in the "Run Immediately" and call the OFC action in the "Run Asynchronously".
Scheduled Path
To create or update multiple records in a batch from a data loader or program, run the Scheduled Path with a batch size of 1.
Call the OFC action with the scheduled path.
Set "1" for the Batch Size.
About Schedule-Triggered Flow
OFC actions cannot be used in a Schedule-Triggered flow. If you want to use it in a Schedule-Triggered Flow, update the record in the Schedule-Triggered Flow and call the OFC action in the Record-Triggered Flow.
1. Create Record-Triggered Flow
Execute OFC action with batch size 1 in Scheduled Paths
2. Create Scheduled-Triggered Flow
Update with the conditions of the created Record-Triggered Flow
Memo
Record-Triggered-Flow should be executed with a batch size of 1 in Scheduled Paths. Even if you update one record at a time by loop processing in the Schedule-Triggered Flow, multiple records will be passed to the Record-Triggered-Flow in a batch. This is due to Salesforce's specification for Flow Bulkification.
Flow Bulkification in Transactions
Note・Limitations
- When the "Private" field in the Opportunity object is checked on, the Record-Triggered Flow is not triggered after saving. (Reference: Opportunity Fields)
- Knowledge of flow creation is required. Inquiry support does not cover standard Salesforce functions such as how to create flows, flow errors, etc.