Work Plan and Work Step Actions
For more information about Field Service, see the Field Service Developer Guide.
These actions are available in API version 52.0 and later. They require Field Service to be enabled.
- Add Work Plans Limits
- You can generate work plans linked to work orders via the addWorkPlans flow, but, by default, users can only generate 100 work plans per work order.
Supported REST HTTP Methods
- URIs
- Add work plans: /services/data/vXX.X/actions/standard/addWorkPlans
- Add work steps: /services/data/vXX.X/actions/standard/addWorkSteps
- Generate work plans: /services/data/vXX.X/actions/standard/generateWorkPlans
- Delete work plans: /services/data/vXX.X/actions/standard/deleteWorkPlans
- Formats
- JSON, XML
- HTTP Methods
- GET, HEAD, POST
- Authentication
- Authorization: Bearer token
Add Work Plans
URI: /services/data/vXX.X/actions/standard/addWorkPlans
This action creates work plan records from the work plan library.
Input | Details |
---|---|
recordId |
|
workPlanTemplateIdList |
|
Output | Details |
---|---|
recordId |
|
workPlanIdList |
|
- Sample Input
-
The following code sample adds work plans:
{ "inputs" : [ { "recordId" : "0WOxx00000007j3", "workPlanTemplateIdList" : ["7Iyxx0000004LSS", "7Iyxx0000004LTT"] }] }
- Sample Output
-
The following code sample illustrates a response after a successful request.
-
[ { "actionName" : "addWorkPlans", "errors" : null, "isSuccess" : true, "outputValues" : { "recordId" : "0WOxx00000007j3", "workPlanIdList" : ["0gqxx0000000Adh", "0gqxx0000000Adi"] } } ]
Add Work Steps
URI: /services/data/vXX.X/actions/standard/addWorkSteps
This action creates work step records from the work plan library.
Input | Details |
---|---|
recordId |
|
workStepTemplateIdList |
|
Output | Details |
---|---|
recordId |
|
workStepIdList |
|
- Sample Input
-
The following code sample adds work steps:
{ "inputs" : [ { "recordId" : "0gqRM0000004DxoYAE", "workStepTemplateIdList" : ["4L0xx0000004FJoCAM", "4L0xx0000004FJoNAC"] }] }
- Sample Output
-
The following code sample illustrates a response after a successful request.
-
[ { "actionName" : "addWorkSteps", "errors" : null, "isSuccess" : true, "outputValues" : { "recordId" : "0gqRM0000004DxoYAE", "workstepIdList" : ["0hFxx00000007uLEAQ", "0hFxx00000007uRAUW"] } } ]
Generate Work Plans
URI: /services/data/vXX.X/actions/standard/generateWorkPlans
This action generates work plans based off rules defined in the work plan library.
Input | Details |
---|---|
recordId |
|
Output | Details |
---|---|
recordId |
|
workPlanIdList |
|
- Sample Input
-
The following code sample generates a work plan:
{ "inputs" : [ { "recordId" : "0WOxx00000007j3" }] }
- Sample Output
-
The following code sample illustrates a response after a successful request.
-
[ { "actionName" : "generateWorkPlans", "errors" : null, "isSuccess" : true, "outputValues" : { "recordId" : "0WOxx00000007j3", "workPlanIdList" : ["0gqxx0000000Adh", "0gqxx0000000Adi"] } } ]
Delete Work Plans
URI: /services/data/vXX.X/actions/standard/deleteWorkPlans
This action deletes all the work plans (and its child work steps) associated with a WorkOrder or WorkOrderLineItem.
Input | Details |
---|---|
recordId |
|
Output | Details |
---|---|
recordId |
|
workPlanIdList |
|
- Sample Input
-
The following code deletes a work plan:
{ "inputs" : [ { "recordId" : "OWOxxxxxxxxxxxx" }] }
- Sample Output
-
The following code sample illustrates a response after a successful request.
-
[ { "actionName" : "deleteWorkPlans", "errors" : null, "isSuccess" : true, "outputValues" : { "recordId" : "0WORM000000621X", "workPlanIdList" : [ "0gqRM0000004CRS" ] } } ]