Sunteți pe pagina 1din 50

March 2015

Territory Management Web


Services

Release 9
Copyright © 2005, 2014 Oracle and/or its affiliates. All rights reserved.

This software and related documentation are provided under a license agreement containing restrictions on use
and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license
agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit,
distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering,
disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. If you
find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf
of the U.S. Government, the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs
installed on the hardware, and/or documentation, delivered to U.S. Government end users are “commercial
computer software” pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental
regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any
operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be
subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S.
Government.

This software or hardware is developed for general use in a variety of information management applications. It is not
developed or intended for use in any inherently dangerous applications, including applications that may create a
risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to
take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation
and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous
applications.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used
under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD
logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a
registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information on content, products, and
services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all
warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its
affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party
content, products, or services.

Documentation Accessibility
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at
http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.

Access to Oracle Support


Oracle customers have access to electronic support through My Oracle Support. For information, visit
http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit
http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.
Contents

1 Introduction.................................................................................................................... 7
2 Territory Data Object .................................................................................................... 9

List of Entities ........................................................................................................................ 9


Territory (Header) .......................................................................................................... 9
Territory Resource ....................................................................................................... 10
Territory Line of Business ............................................................................................. 11
Territory Rule................................................................................................................. 11
Territory Rule Boundary .............................................................................................. 11
Territory Rule Boundary Value................................................................................... 11
Territory Custom Child ................................................................................................ 12

Entity Attributes .................................................................................................................. 12


Territory Header........................................................................................................... 12
Territory Resource ....................................................................................................... 15
Territory Line of Business ............................................................................................. 17
Territory Rule................................................................................................................. 17
Territory Rule Boundary .............................................................................................. 18
Territory Rule Boundary Value................................................................................... 19
Territory Custom Child Entity ..................................................................................... 19
3 Proposal Data Object ................................................................................................ 21

List of Entities ...................................................................................................................... 21


Territory Proposal ......................................................................................................... 21
Territory Proposal Custom Child ............................................................................... 22

Entity Attributes .................................................................................................................. 22


Proposal........................................................................................................................ 22
Territory Proposal Custom Child Entity ..................................................................... 23
4 Dimension Data Object ............................................................................................. 25

List of Entities ...................................................................................................................... 25


Territory Dimension...................................................................................................... 25
Territory Dimension Translation.................................................................................. 25
Territory Dimension Member ..................................................................................... 26
Territory Dimension Member Translation ................................................................. 26

Entity Attributes .................................................................................................................. 26

Territory Management Web Services 3


Contents

Territory Dimension ......................................................................................................26


Territory Dimension Translation ..................................................................................27
Territory Dimension Member......................................................................................27
Territory Dimension Member Translation..................................................................28
5 Territory Service ............................................................................................................ 29

Operations .......................................................................................................................... 29
getTerritory ...................................................................................................................29
findTerritories ................................................................................................................29
addExistingTerritoryToProposal ..................................................................................30
addExistingTerritoryToProposalReturnsTerritory .......................................................30
addNewTerritoryToProposal ......................................................................................31
updateTerritoryInProposal .........................................................................................31
mergeTerritoryInProposal ...........................................................................................31
moveTerritoriesInProposal ..........................................................................................32
deleteTerritoryRule ......................................................................................................32
deleteTerritoryRuleBoundary .....................................................................................32
deleteTerritoryRuleBndryValue .................................................................................33
deleteTerritoryResource .............................................................................................33
deleteTerritoryLineOfBusiness ....................................................................................33
deleteTerritoryInheritedDimension (OBSOLETE) ......................................................34
transformTerritoryUserKeysToIDs (OBSOLETE) ...........................................................34
processTerritoryRuleBoundaryValue ........................................................................34
6 Territory Proposal Service ........................................................................................... 35

Operations .......................................................................................................................... 35
getProposal ..................................................................................................................35
findProposals ................................................................................................................35
createProposal ............................................................................................................36
updateProposal ..........................................................................................................36
deleteProposal ............................................................................................................36
requestProposalActivation ........................................................................................37
reopenProposal ...........................................................................................................37
7 Territory Dimension Service ........................................................................................ 39

Operations .......................................................................................................................... 39
getTerritoryDimension .................................................................................................39
findTerritoryDimension ................................................................................................39
getTerritoryDimensionMember .................................................................................40
findTerritoryDimensionMember .................................................................................40
8 Service Usage Examples ............................................................................................ 41

4 Territory Management Web Services



Introduction List of Entities

Example 1 ........................................................................................................................... 41

Example 2 ........................................................................................................................... 44

Example 3 ........................................................................................................................... 46

Example 4 ........................................................................................................................... 47

Territory Management Web Services 5


1 Introduction

This document describes how territories within the Oracle Sales Cloud can be accessed
and maintained using a programming interface, i.e., SOAP based web services.
The document will explain what objects are involved, the services and operations
available to access them, as well as the related business rules.

In Territory Management, there are two main objects: territories and proposals.

Territories are organized into a hierarchy, so that every territory except for the top one
has a parent. Each territory:
• Has an owner
• May have any number of additional team members, and
• Typically, but not necessarily, has a coverage defined
The territory coverage is what identifies the scope of responsibility of the territory
team in the market space.

Proposals are the vehicles enabling territory creation and updates. A proposal is the
container within which territory changes are modeled, and then activated on a
specified date. Proposals are very light weight objects, typically they just have an owner,
a name and an activation date specified.

A proposal may contain the changes to multiple territories. Initially, a territory is added to
the proposal, which makes it available for update, then the updates are made, and the
proposal is activated, which is the event that propagates the territory updates within
that proposal into the active territory hierarchy.

There are some differences between the objects and attributes exposed in the object
model, and the equivalent constructs exposed in the user interface. Wherever
applicable, the equivalencies are identified within this document, so that it is easier to
correlate operations that can be performed using the back end and front end
interfaces.

Additional information can be obtained from the Oracle Enterprise Repository:


https://fusionappsoer.oracle.com

Territory Management Web Services 7


2 Territory Data Object

This section has a description of the entities in the territory data object, and their
attributes.

List of Entities

Territory Service Data object (SDO)

Territory (Header)

Territory Rule

Territory Rule
Boundary

Territory Rule
Territory Resource
Boundary Value

Territory Line of
Business

Territory Custom Child

Territory (Header)
The Territory Header entity contains all versions of the territories in the system.

Territory Management Web Services 9


Territory Data Object ▪ List of Entities

It is important to note that each territory (identified by Territory ID or Territory Number) will
typically have multiple rows in this entity (identified by Territory Version ID). Following are
the characteristics of the different types of territory versions in this entity:
• Currently active version
There is a single active version for every active territory in the system. The active
version can be distinguished using the following combination of attributes:
o StatusCode = FINALIZED
o Current date is between territory version’s EffectiveStartDate and
EffectiveEndDate
For convenience, there is also a single system maintained attribute that can
be used: LatestVersionFlag.
• Historical (previously active) version
There may be zero to any number of historical versions for every territory in the
system. A historical version can be distinguished using the following combination
of attributes:
o StatusCode = FINALIZED
o Current date is after territory version’s EffectiveEndDate
• Deleted version
This is a special type of historical territory version. It is created only if the territory
has been deleted, i.e., there is no active version for the territory anymore. A
deleted version can be distinguished using the following combination of
attributes:
o StatusCode = DELETED
• Draft (proposed) version
There may be zero to any number of draft territory versions. A draft version is
created any time the territory is added to a proposal. A draft version can be
distinguished using the following attribute:
o StatusCode = DRAFT

Territory Resource
The equivalent term for resource in UIs is “team member”.
The records in this entity contain all team members for historical, active and draft
territory versions. Each territory must have an owner, so each of the above types of
territory versions has at least one record here.
Note that the territory owner is also stored in the Territory entity.

10 Territory Management Web Services



Territory Data Object List of Entities

Territory Line of Business


The records in this entity contain all lines of business for historical, active and draft
territory versions.

Territory Rule
The equivalent term for rule in UIs is “coverage”.
This entity contains a record for each of the coverages for historical, active and draft
territory versions. A territory version may have no coverages at all (if it’s a grouping
territory), or may have coverages such as Dimensional Coverage, Included Customers,
etc. There are the following possible types of coverages:
• For Customer Centric territories (where territory version’s CoverageModel =
SALES_ACCOUNT_CENTRIC)
o Dimensional Coverage (RuleTypeCode = REGULAR)
o Included Customers (RuleTypeCode = INCLUSION)
o Excluded Customers (RuleTypeCode = EXCLUSION)
• For Partner Centric territories (where territory version’s CoverageModel =
PARTNER_CENTRIC)
o Dimensional Coverage (RuleTypeCode = PARTNER_REGULAR)
o Included Partners (RuleTypeCode = PARTNER_INCLUSION)
o Excluded Partners (RuleTypeCode = PARTNER_EXCLUSION)
• For territories that inherit from other territories
o Dimensional Override (RuleTypeCode = INHERITANCE_OVERRIDE)

Territory Rule Boundary


The equivalent functional term for rule boundary is “coverage dimension”.
This entity contains records for the dimensions in territory coverages. For example, if the
Geography and Product dimensions are enabled, there will be records for these two
dimensions for each Dimensional coverage.

Territory Rule Boundary Value


The equivalent functional term for rule boundary value is “coverage dimension
member”.
This entity contains records for the dimension members for each coverage dimension.
For example, there will be records here for all Geography dimension members that have
been selected in each Dimensional coverage, such as USA, Canada, Mexico.

Territory Management Web Services 11


Territory Data Object ▪ Entity Attributes

Territory Custom Child


This entity is optionally present, if defined using Application Composer. It contains
territory custom object records.

Entity Attributes

Territory Header

Attribute Description and Additional Information

TerritoryID Identifier of the territory.


System generated.

TerritoryNumber User definable unique identifier of the territory. Exposed in UIs.


Mandatory. Can be supplied as input at territory creation. System
generated if not supplied.

TerritoryVersionID Unique identifier of the territory version.


System generated.

ParentTerritoryID Identifier of the parent territory.


Every territory exept for the top territory in the hierarchy has this
attribute populated.

StatusCode Identifies the territory version status – DRAFT, FINALIZED, DELETED.


System maintained. Valid values are in lookup
MOT_TERRITORY_VERSION_STATUS. Setup task: Manage Territory
Management Nonextensible Lookups.

LatestVersionFlag Identifies the latest active version of the territory.


System maintained.

TerritoryLevel Identifies the distance of the territory from the top of the territory
hierarchy, ex: the top territory has level = 1, its child territory has
level = 2, etc.
System maintained.

12 Territory Management Web Services



Territory Data Object Entity Attributes

Attribute Description and Additional Information

TerrProposalID Identifies the proposal within which the territory version was
created.

Name The territory name.


Mandatory. Doesn’t have to be unique.

Description The territory description.


Optional.

EffectiveStartDate The start date of the territory version. Maintained by the system
based on proposal activation date, ex: when a proposal is
activated, territory updates result in new versions whose start dates
are set based on the proposal activation date.

EffectiveEndDate The end date of the territory version. Maintained by the system
based on proposal activation date, ex: when a proposal is
activated, the end dates of previously active versions of updated
territories are set accordingly.

OwnerResourceID The ID of the territory owner.


Mandatory.

Owner Name of territory owner.


Derived from OwnerResourceID.

CoverageModel Identifies whether the territory coverage is based on customer or


partner attributes.
Mandatory for territories with coverage. Defaulted to
SALES_ACCOUNT_CENTRIC. The other possible value is
PARTNER_CENTRIC. Valid values are in lookup
MOT_TERR_COVERAGE_MODEL. Setup task: Manage Territory
Management Nonextensible Lookups.

TypeCode Identifies the type of territory.


Mandatory. Defaulted to PRIME. Valid values are in lookup
MOT_TERRITORY_TYPE. Setup task: Manage Territory Lookups.

ForecastParticipati Identifies whether the territory participates in forecasting, and if yes,


onCode in what way.
Optional. Valid values are in lookup
MOT_TERR_FCAST_PARTICIPATION. Setup task: Manage Territory

Territory Management Web Services 13


Territory Data Object ▪ Entity Attributes

Attribute Description and Additional Information


Management Nonextensible Lookups.

ForecastedByPare Indicates if the territory is forecasted by its parent territory.


ntTerritoryFlag
Valid values are Y and N.

EligibleForQuotaFla Indicates whether this territory version is eligible for quota.


g
Valid values are Y and N.

ReviseQuotaFlag Indicates whether quota should be revised, ex: as a result of


updates to this territory version.
Valid values are Y and N.

RevisionReason The reason for quota revision. Valid values are in lookup
MOT_QUOTA_REASON. Setup task: Manage Territory Quota Revision
Reasons.

RevisionDescription The description for the quota revision.

SourceTerrID The source territory, from which this territory is inheriting its
coverage.
Populated for inheriting territories.

SourceTerrVersionI The source territory version.


D

SourceTerrName The name of the source territory. Derived from SourceTerrVersionID.

SourceTerrLastUpd Keeps track of when the source territory was last updated. System
ateDate maintained.

StageCode Identifies whether the territory is published or submitted within a


proposal. Typically, this attribute is not populated.
Optional. Valid values are in lookup
MOT_TERRITORY_VERSION_STAGE. Setup task: Manage Territory
Management Nonextensible Lookups.

PartnerID The partner organization associated with the territory. This attribute
is typically populated for territories, whose TypeCode = PARTNER.

PartnerName The name of the partner organization. Derived from PartnerID.

PartnerProgramID The partner program associated with the territory.

14 Territory Management Web Services



Territory Data Object Entity Attributes

Attribute Description and Additional Information

ProgramName The name of the partner program. Derived from PartnerProgramID.

OrganizationID Obsolete

OwnerOrgID Obsolete

OrganizationName Obsolete

ApplyOptionalVali Obsolete
dationsFlag

Note: in addition to the attributes supported out of the box, as listed above, the
following attributes are available, if the territory header object has been extended using
Application Composer. The Attribute name of an extended attribute in the service
payload is comprised of the name entered in Application Composer, with the suffix
“_c”, ex: CustomAttribute_c.

Attribute Description and Additional Information

EXTN_ATTRIBUTE_C Attributes of character data type reserved for custom extension.


HAR001….350

EXTN_ATTRIBUTE_nu Attributes of number data type reserved for custom extension.


mber001….200

EXTN_ATTRIBUTE_TI Attributes of timestamp data type reserved for custom extension.


MESTAMP001….50

EXTN_ATTRIBUTE_CL Attributes of clob data type reserved for custom extension.


OB001….25

Territory Resource

It is optional for a territory to have team members, other than the owner. The owner can
be maintained within the Territory entity, so typically, the use of this entity is necessary
only if there are additional territory team members.

Attribute Description and Additional Information

Territory Management Web Services 15


Territory Data Object ▪ Entity Attributes

Attribute Description and Additional Information

TerrResourceID Unique identifier of the record. System maintained.

TerritoryVersionID Reference to the territory version.

ResourceID The ID of the territory team member.

ResourceName Name of team member. Derived from ResourceID.

RoleName Team member’s resource role. Derived from ResourceID.

ReportsTo Name of team member’s manager. Derived via ResourceID.

FunctionCode Team member’s function.


Optional. Valid values are in lookup
MOT_TEAM_MEMBER_FUNCTION. Setup task: Manage Team
Member Functions.

ResourceOrgID Obsolete

AdministratorFlag Indicates whether the team member is a territory administrator.


Valid values are Y and N.

ManageForecastFl Indicates whether the team member is a forecasting delegate.


ag Valid values are Y and N.

OrganizationName Obsolete

Note: in addition to the attributes supported out of the box, as listed above, the
following attributes are available, if the territory resource object has been extended
using Application Composer. The Attribute name of an extended attribute in the service
payload is comprised of the name entered in Application Composer, with the suffix
“_c”, ex: CustomAttribute_c.

Attribute Description and Additional Information

EXTN_ATTRIBUTE_C Attributes of character data type reserved for custom extension.


HAR001….350

EXTN_ATTRIBUTE_nu Attributes of number data type reserved for custom extension.


mber001….200

16 Territory Management Web Services



Territory Data Object Entity Attributes

Attribute Description and Additional Information

EXTN_ATTRIBUTE_TI Attributes of timestamp data type reserved for custom extension.


MESTAMP001….50

EXTN_ATTRIBUTE_CL Attributes of clob data type reserved for custom extension.


OB001….25

Territory Line of Business

It is optional for a territory to have associated lines of business. Lines of business may be
helpful in opportunity or lead assignment.

Attribute Description and Additional Information

TerrLoBID Unique identifier of the record. System maintained.

TerritoryVersionID Reference to the territory version.

LoBCode The line of business.


Mandatory. Valid values are in lookup MOT_LINE_OF_BUSINESS.
Setup task: Manage Territory Lines of Business.

Meaning Line of business meaning. Derived from LoBCode.

Territory Rule

If a territory has coverage, then it will have at least one rule record.

Attribute Description and Additional Information

TerrRuleID Unique identifier of the record. System maintained.

TerritoryVersionID Reference to the territory version.

RuleNumber A unique number within a territory definition. System maintained.

Territory Management Web Services 17


Territory Data Object ▪ Entity Attributes

Attribute Description and Additional Information

RuleTypeCode Used to identify the type of territory coverage.


If the territory coverage model is Customer Centric
(CoverageModel = SALES_ACCOUNT_CENTRIC), use the value
REGULAR for dimensional coverages; use the value INCLUSION for
included customer coverages; and use the value EXCLUSION for
excluded customer coverages.
If the territory coverage model is Partner Centric (CoverageModel
= PARTNER_CENTRIC), use the value PARTNER_REGULAR for
dimensional coverages; use the value PARTNER_INCLUSION for
included partner coverages; and use the value
PARTNER_EXCLUSION for excluded partner coverages.
If the coverage is for an inheriting territory, use the value
INHERITANCE_OVERRIDE, which means that the coverage
overrides some of the inherited dimensionality.

RuleOperatorCode Used to identify whether the coverage adds or removes from


territory’s jurisdiction. The value EXCLUSION should be used if
RuleTypeCode is EXCLUSION or PARTNER_EXCLUSION. Use the
value INCLUSION in all other cases.

Territory Rule Boundary

Attribute Description and Additional Information

TerrRuleBoundaryID Unique identifier of the record. System maintained.

TerrRuleID Reference to the territory coverage.

TerrDimensionCode Identifies the dimension. Following are the allowable codes:


• Acct for the Customer dimension
• AcTyp for the Account Type dimension
• CSize for the Customer Size dimension
• Geo for the Geography dimension
• Indst for the Industry dimension
• OrgTp for the Organization Type dimension
• Prod for the Product dimension

18 Territory Management Web Services



Territory Data Object Entity Attributes

Attribute Description and Additional Information


• Schnl for the Sales Channel dimension
• Aux1, Aux2, Aux3 for the auxiliary dimensions
• Prtnr for the Partner dimension

Dimension Dimension display name.

Territory Rule Boundary Value

Attribute Description and Additional Information

TerrRuleBndryValueID Unique identifier of the record. System maintained.

TerrRuleBoundaryID Reference to the rule boundary.

TerrDimIntgID Integration ID of the territory dimension member. This is a unique


identifier of the specific dimension member, ex: identifier of the
postal code “95100” in territory geography setup.

DimensionMember Name of the territory dimension member, ex: “95100”.

TerrDimHighIntgID Integration ID of the territory dimension member, at the end of a


range.

DimensionMemberHi Name of the territory dimension member, at the end of a range,


gh ex: “95200)”.

TerrDimensionCode Identifies the dimension.

IncludeHierarchyFlag Identifies whether the dimension member is included along with


its hierarchy, or not. Allowable values are Y and N.

Territory Custom Child Entity

Attribute Description and Additional Information

ID Unique identifier of the record. System maintained.

Territory Management Web Services 19


Territory Data Object ▪ Entity Attributes

Attribute Description and Additional Information

RecordName Name of the record

TerritoryServiceVO_ID_c Reference to the territory version

EXTN_ATTRIBUTE_CHAR00 Attributes of character data type reserved for custom


1….350 extension.

EXTN_ATTRIBUTE_number0 Attributes of number data type reserved for custom


01….200 extension.

EXTN_ATTRIBUTE_TIMESTA Attributes of timestamp data type reserved for custom


MP001….50 extension.

EXTN_ATTRIBUTE_CLOB001 Attributes of clob data type reserved for custom extension.


….25

20 Territory Management Web Services


3 Proposal Data Object

This section has a description of the proposal entity and its attributes. The proposal entity
has records of all currently open, pending activation, as well as activated proposals.

List of Entities

Territory Proposal Service Data object (SDO)

Territory Proposal

Territory Proposal
Custom Child

Territory Proposal
The Territory Proposal entity contains all proposals in the system. This includes the
following types of proposals:
• Proposals that are currently open and presumably are being worked on
(StatusCode = DRAFT).
• Proposals that have already been activated (StatusCode = ACTIVATED).
• Proposals that are waiting to be activated, ex: future dated proposals that have
been submitted for activation (StatusCode = PENDING ACTIVATION).
• Proposals that are in the process of being activated (StatusCode = PROCESSING).

Territory Management Web Services 21


Proposal Data Object ▪ Entity Attributes

• Proposals that have failed during activation (StatusCode = FAILED).

Territory Proposal Custom Child


This entity is optionally present, if defined using Application Composer. It contains
territory proposal custom object records.

Entity Attributes

Proposal

Attribute Description and Additional Information

TerrProposalID Unique identifier of the proposal.


System generated.

Name Proposal name. Mandatory.

Description Proposal description. Optional.

ActivationDate The date on which the proposal is to be activated.

StatusCode The proposal status.


Mandatory. Defaulted to DRAFT. Valid values are in lookup
MOT_PROPOSAL_STATUS. Setup task: Manage Territory
Management Nonextensible Lookups.

OwnerID Identifier of the proposal owner.


Mandatory. Defaulted to the default proposal owner, specified in
profile option MOT_DEFAULT_RESOURCE. Setup task: Define Default
Proposal Owner.

Owner Proposal owner name.

RequestID Reserved for system use.

PartitionCode Reserved for system use.

ActFailureReasonC Failure reason, for FAILED proposals.

22 Territory Management Web Services



Proposal Data Object Entity Attributes

Attribute Description and Additional Information


ode Valida values are in lookup MOT_PROPOSAL_FAILURE_REASON.
Setup task: Manage Territory Management Nonextensible Lookups.

Note: in addition to the attributes supported out of the box, as listed above, the
following attributes are available, if the proposal object has been extended using
Application Composer. The Attribute name of an extended attribute in the service
payload is comprised of the name entered in Application Composer, with the suffix
“_c”, ex: CustomAttribute_c.

Attribute Description and Additional Information

EXTN_ATTRIBUTE_C Attributes of character data type reserved for custom extension.


HAR001….350

EXTN_ATTRIBUTE_nu Attributes of number data type reserved for custom extension.


mber001….200

EXTN_ATTRIBUTE_TI Attributes of timestamp data type reserved for custom extension.


MESTAMP001….50

EXTN_ATTRIBUTE_CL Attributes of clob data type reserved for custom extension.


OB001….25

Territory Proposal Custom Child Entity

Attribute Description and Additional Information

ID Unique identifier of the record. System maintained.

RecordName Name of the record

TerritoryProposalServiceV Reference to the territory proposal


O_ID

EXTN_ATTRIBUTE_CHAR00 Attributes of character data type reserved for custom


1….350 extension.

EXTN_ATTRIBUTE_number0 Attributes of number data type reserved for custom

Territory Management Web Services 23


Proposal Data Object ▪ Entity Attributes

Attribute Description and Additional Information


01….200 extension.

EXTN_ATTRIBUTE_TIMESTA Attributes of timestamp data type reserved for custom


MP001….50 extension.

EXTN_ATTRIBUTE_CLOB001 Attributes of clob data type reserved for custom extension.


….25

24 Territory Management Web Services


4 Dimension Data Object

This section has a description of the dimension entities and their attributes. The dimension
entity has records for all territory dimensions. The dimension member entity has records
for all dimension members available for use in Territory Management.

List of Entities

Territory Dimension Service Data object (SDO)

Territory Dimension
Territory Dimension
Member

Territory Dimension Territory Dimension


Translation Member Translation

Territory Dimension
This entity contains the list of available territory dimensions. A subset of these may be
active.

Territory Dimension Translation


This entity contains territory dimension translations.

Territory Management Web Services 25


Dimension Data Object ▪ Entity Attributes

Territory Dimension Member


This entity contains the list of available territory dimension members.

Territory Dimension Member Translation


This entity contains territory dimension member translations.

Entity Attributes

Territory Dimension

Attribute Description and Additional Information

TerrDimensionID Unique identifier of the dimension.


System generated.

DimensionCode Identifies the dimension. Following are the allowable codes:


• Acct for the Customer dimension
• AcTyp for the Account Type dimension
• CSize for the Customer Size dimension
• Geo for the Geography dimension
• Indst for the Industry dimension
• OrgTp for the Organization Type dimension
• Prod for the Product dimension
• Schnl for the Sales Channel dimension
• Aux1, Aux2, Aux3 for the auxiliary dimensions
• Prtnr for the Partner dimension

Name Dimension name. Mandatory.

Description Dimension description. Optional.

ActiveFlag Identifies whether the dimension is enabled or not. Valid values are
Y and N.

PartitionID For system use.

26 Territory Management Web Services



Dimension Data Object Entity Attributes

Attribute Description and Additional Information

PartitionTypeCode For system use.

Territory Dimension Translation

Attribute Description and Additional Information

TerrDimensionID Unique identifier of the dimension.


System generated.

Language Language code.

SourceLang Language code, for the original translation records.

Name Dimension name. Mandatory.

Description Dimension description. Optional.

Territory Dimension Member

Attribute Description and Additional Information

TerrDimMemberID Unique identifier of the dimension member record.


System generated.

IntegrationID Unique identifier of the dimension member.

ParentTerrDimMem Identifies the parent dimension member.


berID

ParentDimMember Identifies the parent dimension member.


Name

TerrDimensionID Identifies the dimension.

Territory Management Web Services 27


Dimension Data Object ▪ Entity Attributes

Attribute Description and Additional Information

TerrDimensionCode Identifies the dimension.

Name Dimension member name. Mandatory.

Dimension Dimension member description. Optional.

ActiveFlag Identifies whether the dimension member is active. Valid values


are Y and N.

SortOrder Dimension member sort order. System populated.

TypeCode For system use.

PartitionID For system use.

PartitionTypeCode For system use.

SequenceLow For system use.

SequenceHigh For system use.

Territory Dimension Member Translation

Attribute Description and Additional Information

TerrDimMemberID Unique identifier of the dimension member.


System generated.

Language Language code.

SourceLang Language code, for the original translation records.

Name Dimension member name. Mandatory.

Description Dimension member description. Optional.

28 Territory Management Web Services


5 Territory Service

This section describes the Territory service interface.

The internal name of the Territory service is:


oracle.apps.sales.territoryMgmt.territories.territoryService.TerritoryPublicService

The term “territory object” refers to the attributes of a territory version and related
entities.

Operations

getTerritory

Used to query the attributes of a territory object.

Parameter Description and Additional Information

Input territoryVersionID Unique identifier of territory version.

Output Territory object attributes.

findTerritories

Used to query for a list of territories based on territory object attributes.

Parameter Description and Additional Information

Input findCriteria Criteria to retrieve records.

Territory Management Web Services 29


Territory Service ▪ Operations

Parameter Description and Additional Information

Input findControl Indicates whether to retrieve translations.

Output List of territory objects.

addExistingTerritoryToProposal

Used to perform the Add to Proposal action for an existing territory. This makes it possible
to update territory attributes within the given proposal.

Parameter Description and Additional Information

Input territoryID Territory identifier.

Input territoryProposalID Territory proposal identifier.

Output N/A

addExistingTerritoryToProposalReturnsTerritory

Used to perform the Add to Proposal action for an existing territory. This makes it possible
to update territory attributes within the given proposal. This operation returns the territory
object.

Parameter Description and Additional Information

Input territoryID Territory identifier.

Input territoryProposalID Territory proposal identifier.

Output territoryObject Attributes of the territory object.

30 Territory Management Web Services



Territory Service Operations

addNewTerritoryToProposal

Used to create a territory within a given proposal.

Parameter Description and Additional Information

Input territoryService Territory object.

Output Territory object.

updateTerritoryInProposal

Used to make updates to a territory or its child entities within a given proposal.

Parameter Description and Additional Information

Input territoryService Territory object.

Output Territory object.

mergeTerritoryInProposal

Used to create the territory (if it doesn’t exist), or update the territory (if it exists), within a
given proposal. This operation supports the creation of child entity records, which is not
possible using the updateTerritoryInProposal operation.

Parameter Description and Additional Information

Input territoryService Territory object.

Output Territory object.

Territory Management Web Services 31


Territory Service ▪ Operations

moveTerritoriesInProposal

Used to move territories from one location in the hierarchy to another.

Parameter Description and Additional Information

Input mvTerritoryIDs Identifiers of territories to be moved.

Input dstTerritoryID Identifier of the new parent territory.

Input proposalID Territory proposal identifier.

Output Territory object.

deleteTerritoryRule

Used to delete a territory’s coverage of a territory within a given proposal, ex: delete the
dimensional coverage or the included customers coverage of the territory.

Parameter Description and Additional Information

Input territoryRule Attributes of the object.

Output N/A

deleteTerritoryRuleBoundary

Used to delete all the selected dimension members for a given dimension, from a
territory’s coverage of a territory within a given proposal. As a result, the territory will
cover the entire dimension, i.e., that dimension’s coverage will be “Any”.

32 Territory Management Web Services



Territory Service Operations

Parameter Description and Additional Information

Input territoryRuleBoundary Attributes of the object.

Output N/A

deleteTerritoryRuleBndryValue

Used to delete a specific dimension member from a territory’s coverage of a territory


within a given proposal.

Parameter Description and Additional Information

Input territoryRuleBndryValu Attributes of the object.


e

Output N/A

deleteTerritoryResource

Used to delete a territory team member of a territory within a given proposal.

Parameter Description and Additional Information

Input territoryResource Attributes of the object.

Output N/A

deleteTerritoryLineOfBusiness

Used to delete a territory line of business value of a territory within a given proposal.

Territory Management Web Services 33


Territory Service ▪ Operations

Parameter Description and Additional Information

Input territoryLineOfBusiness Attributes of the object.

Output N/A

deleteTerritoryInheritedDimension (OBSOLETE)

transformTerritoryUserKeysToIDs (OBSOLETE)

processTerritoryRuleBoundaryValue

Used to perform batch processing for a set of dimension members from a territory’s
coverage, of a territory within a given proposal. Currently only the Delete operation is
supported for batch processing.

Parameter Description and Additional Information

Input changeOperation Operation being requested through the process (ex:


‘Delete’).

Input territoryRuleBndryValu Set of object attributes.


e

Input processControl Attributes that help control the execution of the


batch process operation.

Output N/A

34 Territory Management Web Services


6 Territory Proposal Service

This section describes the Territory Proposal service interface.

The internal name of the service is:


oracle.apps.sales.territoryMgmt.territories.territoryService.TerritoryProposal

Operations

getProposal

Used to retrieve the details of a proposal.

Parameter Description and Additional Information

Input terrProposalID Unique identifier of proposal.

Output proposalObject Proposal object attributes.

findProposals

Used to retrieve a list of proposals. This operation only returns details for the proposal
object, i.e., no details of territories that have been added to the proposal.

Parameter Description and Additional Information

Input findCriteria Criteria to retrieve list of proposals.

Input findControl Control value whether to retrieve translations.

Territory Management Web Services 35


Territory Proposal Service ▪ Operations

Parameter Description and Additional Information

Output proposalObjects List of proposal objects.

createProposal

Used to create a proposal.

Parameter Description and Additional Information

Input territoryProposalServic Proposal object attributes.


e

Output proposalObject Proposal object attributes.

updateProposal

Used to update a proposal.

Parameter Description and Additional Information

Input territoryProposalServic Proposal object attributes.


e

Output proposalObject Proposal object attributes.

deleteProposal

Used to delete a proposal.

36 Territory Management Web Services



Territory Proposal Service Operations

Parameter Description and Additional Information

Input territoryProposalServic Proposal object attributes.


e

Output N/A

requestProposalActivation

Used to add a proposal to the activation queue. The proposal will be activated on the
specified date.

Parameter Description and Additional Information

Input terrProposalID Unique identifier of proposal.

Output N/A

reopenProposal

Used to reopen a proposal, ex: change the proposal status from Pending Activation to
Draft.

Parameter Description and Additional Information

Input terrProposalID Unique identifier of proposal.

Output N/A

Territory Management Web Services 37


7 Territory Dimension Service

This section describes the Territory Dimension service interface.

The internal name of the service is:


oracle.apps.sales.territoryMgmt.territories.dimensionPublicService.TerritoryDimensionPubli
cService

Operations

getTerritoryDimension

Used to retrieve territory dimension based on dimension ID.

Parameter Description and Additional Information

Input terrDimensionID Unique identifier of dimension.

Output dimensionObject Dimension object attributes.

findTerritoryDimension

Used to retrieve a list of territory dimensions based on criteria.

Parameter Description and Additional Information

Input findCriteria Criteria to retrieve list of dimensions.

Input findControl Control value whether to retrieve translations.

Territory Management Web Services 39


Territory Dimension Service ▪ Operations

Parameter Description and Additional Information

Output dimensionObjects List of dimension objects.

getTerritoryDimensionMember

Used to retrieve a territory dimension member based on dimension member ID.

Parameter Description and Additional Information

Input terrDimMemberID Unique identifier of dimension member.

Output dimensionMemberObj Dimension member object attributes.


ect

findTerritoryDimensionMember

Used to retrieve a list of territory dimension members based on criteria.

Parameter Description and Additional Information

Input findCriteria Criteria to retrieve list of dimension members.

Input findControl Control value whether to retrieve translations.

Output dimensionObjects List of dimension objects.

40 Territory Management Web Services


8 Service Usage Examples

In this section, there are examples of how services can be used to accomplish common
sets of operations.

Example 1

Requirement: Create a territory (California – Sales) covering Geography = California.


Assumptions:
• Territory structure pre-exists. The parent territory (United States - Sales)
exists.
• The identifier of new territory’s owner is known.
Operations executed:
• Step1 – createProposal
o All changes to territories require a proposal. Either an existing proposal can be
used, or as in this case, a proposal can be created.
o Sample Payload
<soap:Body xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/types/">
<ns1:createProposal>
<ns1:territoryProposal
xmlns:ns2="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryPublicService/">
<ns2:Name>Create California Sales </ns2:Name>
<ns2:Description>Proposal to create California Sales territory</ns2:Description>
</ns1:territoryProposal>
</ns1:createProposal>
</soap:Body>

• Step 2 – findTerritory (To find the parent Territory identifier)


o All territories, except for the topmost one, have to have a parent. This
operation is used to identify the parent territory ID. Below, we are locating
the active version of the parent territory.
o Sample Payload

Territory Management Web Services 41


Service Usage Examples ▪ Example 1

<soap:Body>
<ns1:findTerritories
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryPublicService/types/"
>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:findAttribute>Name</ns2:findAttribute>
<ns2:findAttribute>TerritoryVersionId</ns2:findAttribute>
<ns2:findAttribute>TerritoryId</ns2:findAttribute>
<ns2:findAttribute>StatusCode</ns2:findAttribute>
<ns2:findAttribute>EffectiveStartDate</ns2:findAttribute>
<ns2:findAttribute>EffectiveEndDate</ns2:findAttribute>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>Name</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>Global</ns2:value>
</ns2:item>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>true</ns2:upperCaseCompare>
<ns2:attribute>StatusCode</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>FINALIZED</ns2:value>
</ns2:item>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>EffectiveEndDate</ns2:attribute>
<ns2:operator>ONORAFTER</ns2:operator>
<ns2:value>2014-11-26</ns2:value>
</ns2:item>
</ns2:group>
<ns2:nested/>
</ns2:filter>
<ns2:excludeAttribute/>
</ns1:findCriteria>
<ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:retrieveAllTranslations/>
</ns1:findControl>
</ns1:findTerritories>
</soap:Body>

• Step 3 – findDimensionMember (To find the California dimension member


identifier)
o Find the unique identifier of the “California” dimension member.
o Sample Payload
<soap:Body>
<ns1:findTerritoryDimensionMember
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/dimensionPublicService/t
ypes/">
<ns1:findCriteria>
<ns4:filter xmlns:ns4="http://xmlns.oracle.com/adf/svc/types/">
<ns4:conjunction>And</ns4:conjunction>
<ns4:group>
<ns4:conjunction>And</ns4:conjunction>
<ns4:upperCaseCompare>true</ns4:upperCaseCompare>
<ns4:item>
<ns4:conjunction>And</ns4:conjunction>
<ns4:upperCaseCompare>true</ns4:upperCaseCompare>
<ns4:attribute>TerrDimensionCode</ns4:attribute>

42 Territory Management Web Services


Service Usage Examples Example 1 ▪

<ns4:operator>=</ns4:operator>
<ns4:value>Geo</ns4:value>
</ns4:item>
<ns4:item>
<ns4:conjunction>And</ns4:conjunction>
<ns4:upperCaseCompare>true</ns4:upperCaseCompare>
<ns4:attribute>PartitionTypeCode</ns4:attribute>
<ns4:operator>=</ns4:operator>
<ns4:value>PRODUCTION</ns4:value>
</ns4:item>
<ns4:item>
<ns4:conjunction>And</ns4:conjunction>
<ns4:upperCaseCompare>true</ns4:upperCaseCompare>
<ns4:attribute>Name</ns4:attribute>
<ns4:operator>=</ns4:operator>
<ns4:value>California</ns4:value>
</ns4:item>
</ns4:group>
</ns4:filter>
<ns5:excludeAttribute xmlns:ns5="http://xmlns.oracle.com/adf/svc/types/"/>
</ns1:findCriteria>
<ns1:findControl>
<ns6:retrieveAllTranslations
xmlns:ns6="http://xmlns.oracle.com/adf/svc/types/">false</ns6:retrieveAllTranslations>
</ns1:findControl>
</ns1:findTerritoryDimensionMember>
</soap:Body>

• Step 4 - addNewTerritoryToProposal
o Create the territory within the proposal created earlier.
o The payload contains the proposal identifier from step 1 (TerrProposalId),
the territory identifier of the parent territory from step 2 (TerritoryId), and
the dimension member integration identifier (IntegrationId) of ‘California’
from step 3.
o Sample Payload
<soap:Body xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/types/">
<ns1:addNewTerritoryToProposal>
<ns1:territoryService
xmlns:ns2="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/">
<ns2:Name>California - Sales</ns2:Name>
<ns2:OwnerResourceId>100010025531616</ns2:OwnerResourceId>
<ns2:ParentTerritoryId>1000</ns2:ParentTerritoryId>
<ns2:TerrProposalId>300100007276385</ns2:TerrProposalId>
<ns2:TerritoryRule>
<ns2:RuleNumber>1</ns2:RuleNumber>
<ns2:RuleOperatorCode>INCLUSION</ns2:RuleOperatorCode>
<ns2:RuleTypeCode>REGULAR</ns2:RuleTypeCode>
<ns2:TerritoryRuleBoundary1>
<ns2:TerrDimensionCode>Geo</ns2:TerrDimensionCode>
<ns2:TerritoryRuleBndryValue1>
<ns2:TerrDimIntgId>999997500682992</ns2:TerrDimIntgId>
<ns2:TerrDimensionCode>Geo</ns2:TerrDimensionCode>
</ns2:TerritoryRuleBndryValue1>
</ns2:TerritoryRuleBoundary1>
</ns2:TerritoryRule>
</ns1:territoryService>
</ns1:addNewTerritoryToProposal>
</soap:Body>

Territory Management Web Services 43


Service Usage Examples ▪ Example 2

• Step 5 – Update Proposal ( To update the proposal with the activation date on
which the proposal activation is intended)
o Sample Payload
<soap:Body>
<ns1:updateProposal
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/types/">
<ns1:territoryProposal
xmlns:ns2="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/">
<ns2:TerrProposalId>300100036992850</ns2:TerrProposalId>
<ns2:ActivationDate>2014-11-30</ns2:ActivationDate>
</ns1:territoryProposal>
</ns1:updateProposal>
</soap:Body>

• Step 6 – requestProposalActivation (To request activation of the proposal to


make the new territory version active)
o In this case, we’re going to request activation of this single change right
away.
o Sample Payload
<soap:Body>
<ns1:requestProposalActivation
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/types/">
<ns1:terrProposalId>300100007276385</ns1:terrProposalId>
</ns1:requestProposalActivation>
</soap:Body>

Example 2

Requirement: Create a grouping territory (i.e., a territory that has no coverage), and a
child territory under it. The child territory covers a single included customer.

Assumptions:
• Territory structure pre-exists. The parent territory (Global) exists, which will
be the parent of the new (North America – Sales) grouping territory.
• Identifier of the customer (PartyId) to be included in the customer
inclusion is known.
• Identifiers of territory owners are known.
Operations executed:
• Step1 – createProposal
o Sample Payload – Refer to example 1, step 1
• Step 2 – findTerritory (To find the parent Territory identifier of Global territory)

44 Territory Management Web Services


Service Usage Examples Example 2 ▪

o Sample Payload – Refer to example 1, step 2


• Step 3 – addNewTerritoryToProposal (To create ‘North America – Sales’ grouping
territory)
o Proposal Identifier of the proposal (TerrProposalId) created in step 1,
Territory Identifier (TerritoryId) of the parent territory identified in step 2 are
passed through the payload.
o Samply Payload

<soap:Body>
<ns1:addNewTerritoryToProposal
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/types/">
<ns1:territoryService xmlns:ns2="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/">
<ns2:Name>North America – Sales</ns2:Name>
<ns2:Description>North America – Sales Grouping Territory </ns2:Description>
<ns2:OwnerResourceId>100010025531616</ns2:OwnerResourceId>
<ns2:ParentTerritoryId>1000</ns2:ParentTerritoryId>
<ns2:TerrProposalId>300100036992836</ns2:TerrProposalId>
<ns2:CoverageModel>SALES_ACCOUNT_CENTRIC</ns2:CoverageModel>
</ns1:territoryService>
</ns1:addNewTerritoryToProposal>
</soap:Body>

• Step 4 – addNewTerritoryToProposal
o Proposal Identifier of the proposal (TerrProposalId) created in step 1,
Territory Identifier (TerritoryId) of the parent territory created in step 3, and
the identifier of customer are passed through the payload.
o Sample Payload – (To add a new territory ‘US – Sales’ as a child territory of
the ‘North America – Sales’ grouping territory)

<soap:Body xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/types/">
<ns1:addNewTerritoryToProposal>
<ns1:territoryService
xmlns:ns2="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/">
<ns2:Name>US - Sales</ns2:Name>
<ns2:OwnerResourceId>100010025531616</ns2:OwnerResourceId>
<ns2:ParentTerritoryId>10000000</ns2:ParentTerritoryId>
<ns2:TerrProposalId>300100007276385</ns2:TerrProposalId>
<ns2:TerritoryRule>
<ns2:RuleNumber>1</ns2:RuleNumber>
<ns2:RuleOperatorCode>INCLUSION</ns2:RuleOperatorCode>
<ns2:RuleTypeCode>REGULAR</ns2:RuleTypeCode>
<ns2:TerritoryRuleBoundary1>
<ns2:TerrDimensionCode>Acct</ns2:TerrDimensionCode>
<ns2:TerritoryRuleBndryValue1>
<ns2:TerrDimIntgId>999997500682992</ns2:TerrDimIntgId>
<ns2:TerrDimensionCode>Acct</ns2:TerrDimensionCode>
</ns2:TerritoryRuleBndryValue1>
</ns2:TerritoryRuleBoundary1>
</ns2:TerritoryRule>
</ns1:territoryService>
</ns1:addNewTerritoryToProposal>
</soap:Body>

• Step 5 – Update Proposal (To update the proposal with the activation date on
which the proposal activation is intended)
o Sample Payload – Refer to example 1, step 5

• Step 6 – requestProposalActivation (To activate the proposal to make the new


territory version active)

Territory Management Web Services 45


Service Usage Examples ▪ Example 3

o Sample Payload – Refer example 1, step 6

Example 3

Requirement: Get the list of all territories that have been added to a given proposal.
Operations executed:
• findProposal
o Sample Payload (To find the identifier of the proposal)
<soap:Body>
<ns1:findProposals
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/types/">
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:findAttribute>Name</ns2:findAttribute>
<ns2:findAttribute>TerrProposalId</ns2:findAttribute>
<ns2:findAttribute>Owner</ns2:findAttribute>
<ns2:findAttribute>StatusCode</ns2:findAttribute>
<ns2:findAttribute>Description</ns2:findAttribute>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>Name</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>Proposal To Create California Sales Territory</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:excludeAttribute/>
</ns1:findCriteria>
<ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:retrieveAllTranslations/>
</ns1:findControl>
</ns1:findProposals>
</soap:Body>

• FindTerritories
o Proposal Identifier of the proposal (TerrProposalId) identified in step 1 is
passed through the payload.
o Sample Payload
<soap:Body>
<ns1:findTerritories
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/types/">
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:findAttribute>Name</ns2:findAttribute>
<ns2:findAttribute>TerritoryVersionId</ns2:findAttribute>

46 Territory Management Web Services


Service Usage Examples Example 4 ▪

<ns2:findAttribute>TerritoryId</ns2:findAttribute>
<ns2:findAttribute>StatusCode</ns2:findAttribute>
<ns2:findAttribute>EffectiveStartDate</ns2:findAttribute>
<ns2:findAttribute>EffectiveEndDate</ns2:findAttribute>
<ns2:findAttribute>LatestVersionFlag</ns2:findAttribute>
<ns2:findAttribute>TerrProposalId</ns2:findAttribute>
<ns2:findAttribute>OwnerResourceId</ns2:findAttribute>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>TerrProposalId</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>300100009760952</ns2:value>
</ns2:item>
</ns2:group>
<ns2:nested/>
</ns2:filter>
<ns2:excludeAttribute/>
</ns1:findCriteria>
<ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:retrieveAllTranslations/>
</ns1:findControl>
</ns1:findTerritories>
</soap:Body>

Example 4

Requirement: Update a territory (California – Sales). Update the territory owner and add
two industries into the Industry dimension (i.e., changing Industry from ANY to covering
"Financial Services" and "Wealth Management")
Assumptions:
• Territory structure pre-exists. The California – Sales territory exists.
• The identifier of the owner is known.
Operations executed:
• Step1 – createProposal
o Sample Payload – Refer to example 1, step 1
• Step 2 – findTerritory (To find the Territory identifier of the ‘California – Sales’
territory )
o Sample Payload – (To find the territory identifier of the ‘California –
Sales’ territory, which will be modified.)
<soap:Body>
<ns1:findTerritories
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryPublicService/types/"
>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">

Territory Management Web Services 47


Service Usage Examples ▪ Example 4

<ns2:findAttribute>Name</ns2:findAttribute>
<ns2:findAttribute>TerritoryVersionId</ns2:findAttribute>
<ns2:findAttribute>TerritoryId</ns2:findAttribute>
<ns2:findAttribute>StatusCode</ns2:findAttribute>
<ns2:findAttribute>EffectiveStartDate</ns2:findAttribute>
<ns2:findAttribute>EffectiveEndDate</ns2:findAttribute>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>Name</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>California - Sales</ns2:value>
</ns2:item>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>true</ns2:upperCaseCompare>
<ns2:attribute>StatusCode</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>FINALIZED</ns2:value>
</ns2:item>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>EffectiveEndDate</ns2:attribute>
<ns2:operator>ONORAFTER</ns2:operator>
<ns2:value>2014-11-26</ns2:value>
</ns2:item>
</ns2:group>
<ns2:nested/>
</ns2:filter>
<ns2:excludeAttribute/>
</ns1:findCriteria>
<ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:retrieveAllTranslations/>
</ns1:findControl>
</ns1:findTerritories>
</soap:Body>

• Step 3 – addExistingTerritoryToProposalReturnsTerritory
o Proposal Identifier of the proposal (TerrProposalId) created in step
1, Territory Identifier (TerritoryId) of the territory in step 2 are passed
through the payload. This operation creates a draft version of the
territory to be updated and returns details of the territory through
the returned territory object.
o Sample Payload

<soap:Body>
<ns1:addExistingTerritoryToProposalReturnsTerritory
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/t
ypes/">
<ns1:territoryId>1000</ns1:territoryId>
<ns1:territoryProposalId>300100036992836</ns1:territoryProposalId>
</ns1:addExistingTerritoryToProposalReturnsTerritory>
</soap:Body>

• Step 4 – findDimensionMember (To find the California dimension member


o Sample Payload – (To find the dimension member details for
industry dimension. In the example below we will make a call to

48 Territory Management Web Services



Service Usage Examples Example 4

find all the dimension members of Industry dimensions. If you want


to find a specific dimension member details by name then refer to
the step 3 in example 1 for sample payload)

<soap:Body>
<ns1:findTerritoryDimensionMember
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/dimensionPublic
Service/types/">
<ns1:findCriteria>
<ns4:filter xmlns:ns4="http://xmlns.oracle.com/adf/svc/types/">
<ns4:conjunction>And</ns4:conjunction>
<ns4:group>
<ns4:conjunction>And</ns4:conjunction>
<ns4:upperCaseCompare>true</ns4:upperCaseCompare>
<ns4:item>
<ns4:conjunction>And</ns4:conjunction>
<ns4:upperCaseCompare>true</ns4:upperCaseCompare>
<ns4:attribute>TerrDimensionCode</ns4:attribute>
<ns4:operator>=</ns4:operator>
<ns4:value>Indst</ns4:value>
</ns4:item>
<ns4:item>
<ns4:conjunction>And</ns4:conjunction>
<ns4:upperCaseCompare>true</ns4:upperCaseCompare>
<ns4:attribute>PartitionTypeCode</ns4:attribute>
<ns4:operator>=</ns4:operator>
<ns4:value>PRODUCTION</ns4:value>
</ns4:item>
</ns4:group>
</ns4:filter>
<ns5:excludeAttribute xmlns:ns5="http://xmlns.oracle.com/adf/svc/types/"/>
</ns1:findCriteria>
<ns1:findControl>
<ns6:retrieveAllTranslations
xmlns:ns6="http://xmlns.oracle.com/adf/svc/types/">false</ns6:retrieveAllTranslations>
</ns1:findControl>
</ns1:findTerritoryDimensionMember>
</soap:Body>

• Step 3 – mergeTerritoryToProposal (To update the territory owner and add


additional dimensional coverage)
o Identifier of the new owner, identifier of the dimensional coverage
(TerrRuleId) and dimension member identifier of two industry
dimension members are passed through the payload.
o This operation creates a new industry boundary in the existing
dimensional coverage
o Sample Payload
<soap:Body>
<ns1:mergeTerritoryInProposal
xmlns:ns1="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/t
ypes/">
<ns1:territoryService
xmlns:ns2="http://xmlns.oracle.com/apps/sales/territoryMgmt/territories/territoryService/"
>
<ns2:TerritoryVersionId>300100036992844</ns2:TerritoryVersionId>
<ns2:OwnerResourceId>100010032752767</ns2:OwnerResourceId>

Territory Management Web Services 49


Service Usage Examples ▪ Example 4

<ns2:TerritoryRule>
<ns2:TerritoryVersionId>300100036992844</ns2:TerritoryVersionId>
<ns2:TerritoryRuleId>300200036992844</ns2:TerritoryRuleId>
<ns2:RuleOperatorCode>INCLUSION</ns2:RuleOperatorCode>
<ns2:RuleTypeCode>INCLUSION</ns2:RuleTypeCode>
<ns2:TerritoryRuleBoundary1>
<ns2:TerritoryRuleId>300200036992844</ns2:TerritoryRuleId>
<ns2:TerrDimensionCode>Indst</ns2:TerrDimensionCode>
<ns2:TerritoryRuleBndryValue1>
<ns2:TerrDimIntgId>ONE VOICE~1</ns2:TerrDimIntgId>
<ns2:TerrDimensionCode>Indst</ns2:TerrDimensionCode>
</ns2:TerritoryRuleBndryValue1>
<ns2:TerritoryRuleBndryValue1>
<ns2:TerrDimIntgId>ONE VOICE~1000</ns2:TerrDimIntgId>
<ns2:TerrDimensionCode>Indst</ns2:TerrDimensionCode>
</ns2:TerritoryRuleBndryValue1>
</ns2:TerritoryRuleBoundary1>
</ns2:TerritoryRule>
</ns1:territoryService>
</ns1:mergeTerritoryInProposal>
</soap:Body>

• Step 4 – Update Proposal (To update the proposal with the activation date
on which the proposal activation is intended)
o Sample Payload – Refer example 1, step 5

• Step 5 – requestProposalActivation (To activate the proposal to make the


new territory version active)
o Sample Payload – Refer example 1, step 6

50 Territory Management Web Services

S-ar putea să vă placă și