Search Results check_unique_rev_class
Overview
APPS.CN_COMP_PLANS_PKG is a PL/SQL package within the Oracle EBS Incentive Compensation (formerly Oracle Compensation) module. Its principal business function is to manage the lifecycle of compensation plans — the master records that define quota, commission, and bonus structures for sales organizations. The package encapsulates the server-side logic used by the Compensation Plan entry form, providing the standard table-handler interface (BEGIN_RECORD / END_RECORD), uniqueness validation, status maintenance, assignment verification, and period-range validation. The header comment (cnplipls.pls, version 120.0) records an early modification to the table handler to support start and end dates for periods, confirming the package's long-standing role in date-effective plan maintenance.
Key Procedures and Functions
- BEGIN_RECORD — Initializes a compensation plan record for insert or update. It accepts the full set of plan attributes, including comp_plan_id, name, description, start/end dates (with prior values for change detection), program type, status code, the allow_rev_class_overlap flag, the descriptive flexfield (attribute_category and attribute1–attribute15), and ORG_ID for multi-org partitioning.
- END_RECORD — Completes the table-handler cycle, committing the plan row along with name, description, date range, program type, status code, and revenue-class overlap flag.
- CHECK_UNIQUE — Returns a Boolean indicating whether a given plan name is unique for the specified plan ID. Documented as public because it is called from the WHEN-VALIDATE-ITEM trigger on the form.
- CHECK_UNIQUE_REV_CLASS — Companion validation ensuring revenue classes attached to a plan do not conflict, supporting the allow_rev_class_overlap business rule.
- SET_STATUS / GET_STATUS — Accessor pair for reading and updating the plan status code, used to drive plan activation and deactivation.
- CHECK_ASSIGNED — The procedure most relevant to the searched term. It verifies whether a compensation plan is referenced by dependent assignments (for example, quota assignments or role-plan mappings) and is typically invoked before allowing deletion or status change of a plan.
- CHECK_PERIOD_RANGE — Validates that plan period dates are consistent and do not overlap improperly, reflecting the documented period start/end date enhancement.
Tables Accessed
The package reads and writes CN_COMP_PLANS and its translated/secure counterpart CN_COMP_PLANS_S. To determine whether a plan is in use, CHECK_ASSIGNED and related logic reference CN_QUOTA_ASSIGNS, CN_RT_QUOTA_ASGNS, CN_ROLE_PLANS, and CN_SRP_PLAN_ASSIGNS. Quota and rule definition are resolved through CN_QUOTA_RULES, while revenue-class hierarchy checks against a plan use CN_DIM_EXPLOSION and CN_DIM_HIERARCHIES.
Usage Notes
CN_COMP_PLANS_PKG is invoked primarily from the Compensation Plan maintenance form via its table-handler and validation triggers; CHECK_UNIQUE is explicitly documented as a WHEN-VALIDATE-ITEM call. Because 12 other packages reference CN_COMP_PLANS_PKG, it also serves as a shared validation layer for concurrent programs and custom extensions that create, status-change, or delete compensation plans. Custom code should reuse CHECK_ASSIGNED prior to any deletion attempt, since the package centralizes the referential-integrity check against assignment tables rather than duplicating that logic.