English
Fx.work
About 801 wordsAbout 3 min
2026-01-09
1. createTask Create Task
Issue Task
Fx.work.createTask(<string title>, <string description>, <integer deadLine>, <object executeUsers>, <object atUsers>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| title | string | Y | |
| description | string | Y | |
| deadLine | integer | Y | |
| executeUsers | object | Y | |
| atUsers | object | Y |
| executeUsers | object | Description | Required |
|---|---|---|---|
| users | array[string] | Y | |
| departments | array[string] | Y |
| atUsers | object | Description | Required |
|---|---|---|---|
| users | array[string] | Y | |
| departments | array[string] | Y |
Return Parameters
Return an example
Understood. Please provide the Chinese documentation you'd like me to translate into professional English according to the specified standards. I'll deliver a precise, complete, and technically accurate translation while maintaining the original formatting, line breaks, and spacing.
I'm ready to begin as soon as you share the content between the dashed lines in the "原始文档" section.Code examples
DateTime deadLine = DateTime.now + 1.days
Fx.work.createTask("hello", "world", deadLine, [users: ["1059"]], [users: ["1059","1025"],departments:["253937"]])Notice
- executeUsers map keys: "users" for users, "departments" for departments
- atUsers map keys: "users" for users, "departments" for departments
2. createTaskV2 Create task V2, returns task ID
Create task v2, returns task ID
Fx.work.createTaskV2(<string title>, <string description>, <integer deadLine>, <boolean multiExecute>, <object executeUsers>, <object atUsers>, <array objects>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| title | string | Y | |
| description | string | Y | |
| deadLine | integer | Y | |
| multiExecute | boolean | Y | |
| executeUsers | object | Y | |
| atUsers | object | Y | |
| objects | array[object] | Y |
| executeUsers | object | Description | Required |
|---|---|---|---|
| users | array[string] | Y | |
| departments | array[string] | Y |
| atUsers | object | Description | Required |
|---|---|---|---|
| users | array[string] | Y | |
| departments | array[string] | Y |
| objects | object | Description | Required |
|---|---|---|---|
| object_api_name | string | Y | |
| id | string | Y |
Return Parameters
| Parameter Name | object | Description |
|---|---|---|
| taskId | string |
Return an example
{"taskId":"taskId"}Code examples
DateTime deadLine = DateTime.now + 1.days
List objects = [
[object_api_name: "object_l9348__c", id: "60d53e038bc25c00016c75f6"],
[object_api_name: "ContractObj", id: "60f54c9c4fc0fa000107c1f7"],
[object_api_name: "ContractObj", id: "8e82821584474cb79ae693c267cc7395"]
]
def (Boolean error, String taskId, String errorMessage) = Fx.work.createTaskV2("hello", "world", deadLine, false, [users: ["1000"]], [users: ["1000"]], objects)
if (error) {
log.info(errorMessage)
} else {
log.info(taskId)
}3. executeTask Execute Task
Execute Task
Fx.work.executeTask(<string taskId>, <integer userId>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| taskId | string | Y | |
| userId | integer | Y |
Return Parameters
| Parameter Name | object | Description |
|---|---|---|
| postId | string |
Return an example
{
"postId": "taskId"
}Code examples
Fx.work.executeTask("3b4d8c49b207417f99941688c8ee719f", "1017")4. cancelTask Cancel Task
Cancel Task
Fx.work.cancelTask(<string taskId>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| taskId | string | Y |
Return Parameters
Return an example
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false
}Code examples
Fx.work.cancelTask("3b4d8c49b207417f99941688c8ee719f")5. createSchedule Create schedule binding business object
Create Schedule Binding Business Object
Fx.work.createSchedule(<string content>, <integer beginTime>, <integer endTime>, <boolean isFullDate>, <boolean needReceipt>, <array remindTimes>, <object attenders>, <array objects>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| content | string | Y | |
| beginTime | integer | Y | |
| endTime | integer | Y | |
| isFullDate | boolean | Y | |
| needReceipt | boolean | Y | |
| remindTimes | array[string] | Y | |
| attenders | object | Y | |
| objects | array[object] | Y |
| attenders | object | Description | Required |
|---|---|---|---|
| users | array[string] | Y | |
| departments | array[string] | Y |
| objects | object | Description | Required |
|---|---|---|---|
| object_api_name | string | Y | |
| id | string | Y |
Return Parameters
| Parameter Name | object | Description |
|---|---|---|
| feedId | string |
Return an example
{
"feedId": "feedId"
}Code examples
DateTime endTime = DateTime.now + 1.hours;
def ret = Fx.work.createSchedule("hello", DateTime.now(), endTime, false, false, [RemindTime.BEGIN()], [users: ["1001","1017","1018"]], [[apiName:"LeadsObj", dataId:"5dc276e1a25b1800018dafe9"], [apiName:"AccountObj", dataId:"5f3f86136ede600001da386e"]]);Reference Interface
- Reference guide: RemindTime.BEGIN.FIVE_MINUTES_AGO.FIFTEEN_MINUTES_AGO.THIRTY_MINUTES_AGO.ONE_HOURS_AGO.TWO_HOURS_AGO
Notice
- atUsers map keys : "users" users, "departments" departments
- object keys : "apiName" object API name, "dataId" business data ID
6. feedBatchAddCcEmployeeToFeeds Add CC recipients to a group of FeedIds
Add CC recipients for a group of FeedIds
Fx.work.feedBatchAddCcEmployeeToFeeds(<array feedIds>, <integer ccEmployeeId>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| feedIds | array[integer] | Y | |
| ccEmployeeId | integer | Y |
Return Parameters
| Parameter Name | object | Description |
|---|---|---|
| succeedFeedIds | array[integer] | |
| failedFeedIds | array[integer] | |
| failedReason | string |
Return an example
{
"succeedFeedIds": [
100000006,
100000004
],
"failedFeedIds": [
100000003,
100000002
],
"failedReason": "xxx"
}Code examples
List feedIds = [100000006,100000004,100000003,100000002]
Integer ccEmployeeId = 1105
def(Boolean error, Map data, String errorMessage) = Fx.work.feedBatchAddCcEmployeeToFeeds(feedIds, ccEmployeeId)
log.info(ret)
if (error) {
log.info(errorMessage)
} else{
log.info(data)
}7. followUpSearchResourceListByUUID Query FeedId in follow-up dynamics
Query the FeedId in the follow-up dynamics
Fx.work.followUpSearchResourceListByUUID(<string objectApiName>, <string objectId>, <integer fromFeedId>, <integer limit>)
Request parameters
Request Body
| Parameter Name | object | Description | Required |
|---|---|---|---|
| objectApiName | string | Y | |
| objectId | string | Y | |
| fromFeedId | integer | Y | |
| limit | integer | Y |
Return Parameters
| Parameter Name | object | Description |
|---|---|---|
| feedIds | array[integer] | |
| hasMore | boolean |
Return an example
{
"feedIds": [
100000006,
100000004
],
"hasMore": true
}Code examples
String objectApiName = "AccountObj"
String objectId = "631859a4cd0f460001e69bf2"
Long fromFeedId = 100000006
Integer limit = 2
def(Boolean error, Map data, String errorMessage) = Fx.work.followUpSearchResourceListByUUID(objectApiName, objectId, fromFeedId, limit)
log.info(ret)
if (error) {
log.info(errorMessage)
} else{
log.info(data)
}Reference object com.fxiaoke.functions.enums.RemindTime
Field description
| Parameter Name | object | 2 hours ago 1 hour ago 30 minutes ago 15 minutes ago 5 minutes ago At the beginning Created by liyiguang on 2018/9/20. |
|---|
