English
Fx.template
About 343 wordsAbout 1 min
2026-01-09
Summary
The overview of this document is as follows: This document introduces the API definitions of Fx.template, usage methods, and related notes.
1. print Use object print templates to output print files
Fx.template.print(<boolean error>, <Email data>, <String errorMessage>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| error | boolean | Whether execution encountered an exception | Y |
| data | Return result | Y | |
| errorMessage | String | Error message | Y |
| data | Return result | Required | |
|---|---|---|---|
| path | String | NPath | Y |
| fileSize | Integer | File size | Y |
| name | String | File name | Y |
| fileType | String | File type | Y |
Return Parameters
| Parameter Name | APIResult | Parameter list |
|---|---|---|
| error | boolean | Indicates whether execution encountered an exception |
| data | Return result | |
| errorMessage | String | Exception message |
Return an example
{
"error": false,
"data": {},
"errorMessage": ""
}Code examples
// Object API Name for printing data
String objectAPIName = "object_kFc8w__c"
// Data ID to print
String objectId = "6209cfbcdac8a0000127187f"
// Template ID
String templateId = "64d5dae417eb092ee3bbd9b1"
// Process instance ID
String instanceId = null
// Document output orientation
String orientation = "Landscape"
// Language tag
String locale = "zh-CN"
def(Boolean error, Map data, String errorMessage) = Fx.template.print(objectAPIName, objectId, templateId, instanceId, orientation, locale)
if (error) {
Fx.log.info("Print error: " + errorMessage)
} else {
Fx.log.info(Fx.json.toJson(data))
}Notice
- Printing may take a long time, so it is recommended to place it after process actions or within asynchronous functions to avoid page execution timeouts.
Changelog
| Version | Date | Changes | Author |
|---|---|---|---|
| v1.0 | 2026-05-20 | Initial version |
Background
This document provides detailed information about the Fx.template API functionality and usage, helping developers integrate relevant capabilities.
Applicable Scenarios
Specific applicable scenarios are determined by actual business needs. Developers can select the appropriate API for integration as required.
Prerequisites
- Access to Fxiaoke Open Platform
- Application authorization and configuration completed
- Basic knowledge of relevant business domain
Steps
Please refer to the detailed instructions for each API.
Notes
- Ensure prerequisites are met before calling APIs
- Pay attention to API call frequency limits
- Refer to error code documentation for exception handling
Compatibility note: This version currently has no deprecated or compatibility notes.
