You are on page 1of 14

Business Technology

Threshold Based Crediting


Technical Design Document
Overview
Scope

Current State

Technical Components
Design Decisions
Eligible ACV
Implementation Approach:
Aggregate ACV
Implementation Approach:
Error Handling
New Components
Modified Components

Diagrams
Current Process
To Be Eligible ACV Flow
To Be Aggregate ACV Flow
Solution Architecture

Test Strategy

References

Q&A

Overview
In the current state, GIC Ops has to follow a manual process to calculate and exclude ECS
reps from orders that are above their individual cut-off thresholds, per incentive comp policy.

Threshold Based Crediting - Technical Design Page 2 of 14


This document highlights the technical design to automate the manual processes followed
by GIC Ops to auto-exclude ECS reps from orders that are above their individual cut-off
thresholds, per incentive comp policy.

Scope
The scope for threshold based crediting is limited to the following:

● The changes are only applicable to ECS selling groups.


● Validate Deal ACV against threshold and exclude CPOs crossing the threshold
values as per incentive comp policy.
● ‘Eligible ACV’ will be calculated based on product eligibility ONLY for ECS selling
groups.
● Consideration of the Eligible ACV value for Dual Manager Exclusion Process.

Current State
In the current state GIC Ops manually exclude ECS reps (CPOs) from orders that are above
their individual cut-off thresholds, per incentive comp policy.

Below are the involved objects and the relationship between them:

Object Name Comments

Order

Order Team Order Team object to be used for overlay compensation.

CEO Commissionable Event Object - used for Employee Incentive


Management.

CPO Commission Participant Object

Deal Relationship Keeps track of all opptys, converted quotes and new contracts.

Quote (CPQ) Holds dates and line items, many quotes/proposals may be related
to a single opportunity, a quote/proposal may have many detail
lines

Threshold Based Crediting - Technical Design Page 3 of 14


Technical Components

Design Decisions
There are 2 separate processes that we are trying to automate as part of TBC:
Threshold Based Crediting - Technical Design Page 4 of 14
1. Exclude/Include CPO and Order Team records of member and CPO records of
Manager based on Eligible ACV
a. In this we are relying on the Product Eligibility Matrix (PEM) data to get the
Eligibility% for the ECS selling group AEs and calculating Eligible ACV.
b. PEM data in Org62 is stored in 2 objects →
Commission Incentive Plan (CIP)
Commission Incentive Unit (CIU)
c. From CPO using Selling Role, Vertical, Market Segment and Role, get the
PEK from the CIP.
d. Use this PEK and Sub-Cloud from the CEO to get Eligibility% from the CIU.
e. Finally calculate Eligible ACV = Participant ACV * Eligibility% → Commissionable
ACV
f. If Eligible ACV = 0 then mark Exclude__c on CPO and sfbase__Exclude__c
on related Order Team
g. Else unmark Exclude__c on CPO and sfbase__Exclude__c on related Order
Team
2. Exclude/Include CPO and Order Team records of member and CPO records of
Manager based on Aggregate ACV
a. To calculate the Aggregate ACV use following priorities after fetching the CPO
records satisfying the criteria →
CEO_Name__r.RecordType.Name IN ('Auto',’Manual’) AND
CEO_Name__r.Commission_Period__c <= THIS_MONTH AND
CEO_Name__r.CEO_Status__c != 'Deleted' AND SellingRole__r.Name LIKE
'%ECS%' AND ECST_Approved__c = FALSE AND
CEO_Name__r.Order_Record_Type__c != 'Attrition'
i. If Deal Number (DealRelationship__r.Name) is present on related
CEO then
Aggregated ACV = Sum of Commissionable ACV of all CEOs falling
under this Deal Number.
ii. Else if Related Quote (CPQ) (SfdcRelatedQuote__c) is present on the
Order then
Aggregated ACV = Sum of Commissionable ACV of all CEOs falling
under this Quote.
iii. Else
Aggregated ACV = Sum of Commissionable ACV of all CEOs related
to the same Order.
iv. Refer to this sheet for scenarios.
b. Get the threshold values from Commission ACV Threshold Configuration
(Commission_ACV_Threshold_Configuration__mdt) custom metadata type:
i. Region from CPO Role__c field = Region__c
ii. CPO MarketSegment__c NOT IN ExcludeMarketSegment__c
iii. CPO Sub_Region__c NOT IN ExcludeSubRegion__c
iv. CPO Vertical__c NOT IN ExcludeVertical__c
v. If IncludeMarketSegment__c != NULL then CPO MarketSegment__c IN
IncludeMarketSegment__c
vi. If IncludeSubRegion__c != NULL then CPO Sub_Region__c IN
IncludeSubRegion__c
vii. If IncludeVertical__c != NULL then CPO Vertical__c IN IncludeVertical__c
viii. If SellingRoleName__c on the CPO IN TeamRole__c
ix. Active__c = TRUE

Threshold Based Crediting - Technical Design Page 5 of 14


c. If the Aggregate ACV (a) > Threshold (b) then
i. Mark Exclude__c on CPO and sfbase__Exclude__c on related Order
Team.
ii. Mark Above Cutoff checkbox on CPO to TRUE.
iii. Add comments in the Threshold-Based Crediting Comment field.
d. Else
i. Unmark Exclude__c on CPO and sfbase__Exclude__c on related
Order Team
ii. Unmark Above Cutoff checkbox on CPO
iii. Remove comments from the Threshold-Based Crediting Comment field.

Eligible ACV

Implementation Approach:
The Eligible ACV will be calculated with Aggregate ACV calculation

Values from CEO/CPO required for fetching Eligibility% from CIP/CIU:


1. CPO__r.MarketSegment__c →
sfom__CommissionIncentivePlan__c.Market_Segment__c
2. CPO__r.Vertical__c →
sfom__CommissionIncentivePlan__c.Vertical__c
3. Region from CPO__r.Role__c →
sfom__CommissionIncentivePlan__c.sfom__Region__c → Geo__c
4. CPO__r.SellingRoleName__c →
sfom__CommissionIncentivePlan__c.SellingRole__c
5. CPO__r.CEO_Name__r.SubCloud__c →
sfom__CommissionIncentiveUnit__c.Subcloud__c
6. sfom__CommissionIncentivePlan__c.PEKMapping__c →
sfom__CommissionIncentiveUnit__c.PEKMapping__c

Schedule-trigger Flow for calling the CalculateAggregateEligibleACVFunctions apex class


which calls ThresholdBasedCreditingBatch apex batch class.

Aggregate ACV
This doc has details on different approaches considered for implementation.

Implementation Approach:
Schedule-trigger Flow for calling the CalculateAggregateEligibleACVFunctions apex class
which calls ThresholdBasedCreditingBatch apex batch class.

Schedule-triggered Flow:
Schedule: @7:00am PST
Frequency: Daily

Threshold Based Crediting - Technical Design Page 6 of 14


Error Handling
Logging any exception occurred during execution in the Org62ErrorLog object with the
following details:
Use Org62ErrorHandlingUtil for error logging.

To Handle exceptions related to platform (eg: LOCKED_ROW) are handled by PML. EOPs
will keep on monitoring the object and report any unexpected issues that they see.

New Components
Custom Fields on CPO (CPO__c) object:

# Name API Type

1 Eligible ACV EligibleACV__c Currency(16, 2)

2 Above Cut-Off AboveCutOff__c Checkbox

3 ECST Approved ECSTApproved__c Checkbox

4 Threshold-Based Crediting ThresholdBasedCreditingComment__c Text (255)


Comment

Flows:

Threshold Based Crediting - Technical Design Page 7 of 14


# Name API Flow Type

1 Aggregate and Eligible AggregateAndEligibleACVS Schedule-Triggered


ACV Scheduler cheduler

Apex Classes:

# Name Methods

1 CalculateAggregateEligibleACVFunct public static void


ions callAggregateEligibleACVBatch()

2 ThresholdBasedCreditingBatch global Database.QueryLocator


start(Database.BatchableContext batchCon)

global void
execute(Database.BatchableContext
batchCon, List<sObject> lSObject)

global void finish(Database.BatchableContext


batchCon)

Modified Components
FLS on Profiles:

# Field API Object Profiles Access

1 EligibleACV__c CPO__c Sales Operations: Commissions Read

Sales Operations: Systems Read

System Administrator Profiles Read/Write

2 AboveCutOff__c CPO__c Sales Operations: Commissions Read

Sales Operations: Systems Read

System Administrator Profiles Read/Write

3 ECSTApproved__c CPO__c Sales Operations: Commissions Read/Write


Threshold Based Crediting - Technical Design Page 8 of 14
Sales Operations: Systems Read

System Administrator Profiles Read/Write

4 ThresholdBasedCredit CPO__c Sales Operations: Commissions Read


ingComment__c

Sales Operations: Systems Read

System Administrator Profiles Read/Write

Threshold Based Crediting - Technical Design Page 9 of 14


Diagrams

Current Process

Threshold Based Crediting - Technical Design Page 10 of 14


To Be Eligible ACV Flow

To Be Aggregate ACV Flow

Threshold Based Crediting - Technical Design Page 11 of 14


Solution Architecture

Test Strategy
1. Create new Test Cases for Eligible ACV and Aggregate ACV scenario
a. Upload the test suit into Taleggio
b. Run the Test Cases as required and update results in Taleggio
2. Create Unit Test Classes.
3. Identify the Regression/Patch test cases from the identified scenarios in step 1.
Run as needed on demand.

Threshold Based Crediting - Technical Design Page 12 of 14


References
No. Assumption Description
1 Eligibility% = 0 if no data is returned from CIP/CIU objects. (PML)
2 The data in CIP/CIU will be updated monthly till the HuiForce automation
3
4
5

Q&A
● Is there a need to update the Eligible ACV periodically? Asking this because the data
on CIU/CIP objects can change which can affect the calculation.
○ Eligible ACV - calculate start of every month until Org62 to Huiforce
automation
○ Daily Nightly job to evaluate CPO records daily
● Which profiles will need access to the newly created fields as part of TBC?
○ Mirror access to CEOs/CPOs - Sales Ops Commissions
● To get PEK from CIP we use the following info from CPO:
1. Selling Role
2. Vertical
3. Market Segment
4. Role
Vertical and Market Seg are multi-select picklists. So do we have to look up the CIP
records which have all the Vertical and Market Seg in it?
○ Managers usually have a multi select picklist. We should map the AEs and
managers should get based on their directs
● What if there is no value for Eligibility% is returned from PEM? Should we consider it
as 0% or 100%?
○ 0%
● We saw that if CEOs are created on an order where deal is involved then on CEO
the Deal Number field is populated but not Deal Relationship. So for aggregation we
should look at Deal Number field or Deal Relationship field?
● How the subRegion on CPO is playing a role in finding GEO on CIP?
● When we say for deal aggregation the CEOs to consider should be of the same
commission period, do we mean the CEOs with commission period falling in the
same month should only be considered along with deal/quote/order aggregation?
● Observation: In production currently there are ~300 000 CEO records of Auto/Manual
RT with previous commission period ( > 1 Apr 2004).
A total of 494 CPO records of prior Commision Period ( < 1 Oct 2021). include Fiscal
Year criteria


● Team Role info from Production

Threshold Based Crediting - Technical Design Page 13 of 14


Should we use Name LIKE ‘%ECS%’ to fetch CPOs?

Threshold Based Crediting - Technical Design Page 14 of 14

You might also like