Results for “get_okc_org_id”

16 results




AI-generated from documented ETRM metadata — verify critical details on the linked pages.

Overview

OKL_CONTEXT is a foundational Multi-Org Access Control (MOAC) utility package within the Oracle E-Business Suite Lease Management (OKL) and Contracts (OKC) modules. Its primary business function is to establish, synchronize, and retrieve the operating unit (ORG_ID) and inventory organization (ORGANIZATION_ID) context that governs data visibility and transactional behavior across the leasing and contracts schemas. Because lease and contract records are partitioned by operating unit and frequently reference specific inventory organizations, downstream packages, forms, and concurrent programs depend on a consistent session-level context. OKL_CONTEXT provides that consistency by writing the appropriate values into the OKC_CONTEXT namespace, which is then queried through SYS_CONTEXT by dependent logic.

The package originated as part of the multi-org context standardization effort, as reflected in its header revision (OKLRCTXB.pls 120.5). It bridges the generic MOAC infrastructure (MO_GLOBAL) and Lease Management-specific system parameters (OKL_SYSTEM_PARAMS_ALL_PUB) into the OKC context, making it an integration point between Oracle's vertical MOAC framework and the OKL/OKC application data model.

Key Procedures and Functions

  • SET_OKC_ORG_CONTEXT — Two overloaded forms exist. The first accepts an operating unit (org_id) and inventory organization (organization_id) as optional parameters; when a parameter is omitted, the procedure derives the inventory organization from the OKL system parameters and the operating unit from the current MOAC session via MO_GLOBAL. The second overload accepts a contract header identifier (chr_id) and derives the organizational values from the OKC_K_HEADERS_V view. Both overloads compare the resolved values against the currently cached context and only invoke OKC_CONTEXT.SET_OKC_ORG_CONTEXT when a change is detected, avoiding unnecessary context resets.
  • GET_OKC_ORGANIZATION_ID — Returns the current inventory organization identifier stored in the OKC_CONTEXT namespace under the ORGANIZATION_ID key. This is the function most commonly referenced by application logic requiring the active inventory organization.
  • GET_OKC_ORG_ID — Returns the current operating unit identifier. The source excerpt shows this function delegating to MO_GLOBAL.GET_CURRENT_ORG_ID, returning the active MOAC operating unit for the session. This is the function most directly associated with the user search term "get_okc_org_id," and it is the standard accessor used by OKL and OKC packages to obtain the current operating unit context without directly querying MO_GLOBAL.

Tables Accessed

Based on the documented metadata, OKL_CONTEXT does not directly manipulate base tables. Instead, it relies on the OKL_SYSTEM_PARAMS_ALL_PUB package API to retrieve the configured inventory organization parameter (G_ITEM_INV_ORG_ID) and on the OKC_K_HEADERS_V view when deriving context from a contract header identifier. The actual context storage is handled by the OKC_CONTEXT package, which populates the OKC_CONTEXT application context. Because the package operates through APIs and views rather than direct DML, it maintains schema isolation and respects the MOAC security model.

Usage Notes

OKL_CONTEXT is not an end-user-facing API; it is infrastructure invoked programmatically and is referenced by 34 other packages within the E-Business Suite. Typical invocation paths include:

  • Lease Management and Contracts forms, which call SET_OKC_ORG_CONTEXT during form initialization and when navigating between records belonging to different operating units.
  • Concurrent programs and batch processes that must establish the correct operating unit and inventory organization before processing lease or contract data.
  • Custom extensions and integrations that must read the active context; such code should call GET_OKC_ORG_ID or GET_OKC_ORGANIZATION_ID rather than querying MO_GLOBAL directly, to ensure consistent behavior with the OKL/OKC framework.
  • Header-driven operations that pass a chr_id to SET_OKC_ORG_CONTEXT, allowing the context to be aligned with the contract header's owning organization.

Because SET_OKC_ORG_CONTEXT validates existing values before resetting context, invoking it repeatedly is inexpensive and safe. Developers should treat OKL_CONTEXT as the authoritative accessor for OKL/OKC organizational context and avoid duplicating its logic in custom code.