Clone Activity Plan And Territories Action

Clones Activity Plan records and associates them with specified territories.

This action is available in API version 67.0 and later.

Supported REST HTTP Methods 

URI: /services/data/vXX.X/actions/standard/cloneActvtyPlanTerritories

Where XX.X is the latest API version.

Formats: JSON, XML

HTTP Methods: POST

Authentication: Authorization: Bearer TOKEN

Where TOKEN is your OAuth access token.

Inputs 

InputTypeDescription
activityPlanToTerritoriesList<Apex>Required
A collection of Apex crtActvtyPlan.ActivityPlanToTerritories records, where each pair contains a source Activity Plan ID and its associated territory IDs.
timePeriodIdStringRequired
The ID of the time period to assign to each newly created Activity Plan record.
activityPlanPrefixStringRequired
The base name prefix for the new Activity Plan records. The territory name is appended to this prefix to form the final Activity Plan name.

Outputs 

OutputTypeDescription
clonedActivityPlanIdsList<String>A list of IDs for the Activity Plan records created during the clone operation.

Example 

Sample Request

1{
2          "inputs": [
3          {
4          "activityPlanToTerritories": [
5          {
6          "activityPlanId": "1APxx0000004C92GAE",
7          "territoryIds": [
8          "0TTxx0000001A23GBF",
9          "0TTxx0000001A24GBF"
10          ]
11          }
12          ],
13          "timePeriodId": "0TPxx0000003B11GAE",
14          "activityPlanPrefix": "FY26_Territory_Plan"
15          }
16          ]
17          }

Sample Response

1[
2          {
3          "actionResult": {
4          "outputValues": {
5          "clonedActivityPlanIds": [
6          "1APxx0000004C95GAE",
7          "1APxx0000004C96GAE"
8          ]
9          },
10          "isSuccess": true,
11          "errors": []
12          }
13          }
14          ]