---
schema_version: "1"
id: b8522b0e361338da271d11ba83b6c1dae32569e3aa471d2a81af5f804781dea5
title: |-
  ActivityPlanToTerritories(activityPlanId,
        territoryIds)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/life_sciences_dev_guide/apex_ActivityPlanToTerritories_ActivityPlanToTerritories.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/apex_ActivityPlanToTerritories_ActivityPlanToTerritories.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 293ec4a67703773327d0adfffbf2faad7ffe04562b20fa064d8e5a57f7c76e2b
description: Creates an instance of the ActivityPlanToTerritories class to pair a source activity plan with territory IDs.
---
# ActivityPlanToTerritories(activityPlanId, territoryIds)

Creates an instance of the ActivityPlanToTerritories class to pair a source activity plan with territory IDs.

## API Version

65.0

## Requires Chatter

No

## Signature

public ActivityPlanToTerritories(String activityPlanId, List<String\> territoryIds)

## Parameters

activityPlanId

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_methods_system_string.htm)

ID of the source activity plan to associate with the specified territories.

territoryIds

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_methods_system_list.htm)<[String](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_methods_system_string.htm)\>

IDs of the territories to assign to the cloned activity plan.

## Return Value

Type: ActivityPlanToTerritories

- **[ActivityPlanToTerritories Properties](https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/apex_input_activity_plan_to_territories.htm)**  
    Properties for pairing a source activity plan ID with territory IDs for assignment.