Search Results okc_template_usages




Overview

The OKC_TEMPLATE_USAGES table is a core data entity within the Oracle E-Business Suite Contracts Core (OKC) module. Its primary function is to manage and record the relationship between a contract terms template (stored in OKC_TERMS_TEMPLATES_ALL) and the specific business document types where that template is authorized for use. This table acts as a critical junction, enforcing business rules by controlling which templates can be applied to different document categories, such as sales orders, purchase agreements, or service contracts. By maintaining these associations, it ensures consistency and standardization in the contractual terms applied across an organization's document portfolio.

Key Information Stored

The table's structure centers on linking a template to its permissible document contexts. The most critical columns are the foreign keys that establish these relationships. The TEMPLATE_ID column stores the unique identifier of the contract terms template from the OKC_TERMS_TEMPLATES_ALL table. The DOCUMENT_TYPE column holds the code for the specific business document type (e.g., from OKC_BUS_DOC_TYPES_B) for which the template is valid. Additionally, the DOC_NUMBERING_SCHEME column can store a reference to a numbering scheme (from OKC_NUMBER_SCHEMES_B) that may be applied to documents created using this template-document type combination. This table is essential for the template selection logic within the Contracts authoring interface.

Common Use Cases and Queries

A primary use case is validating template availability during document creation. When a user initiates a new contract of a specific type, the application queries this table to determine which pre-approved templates can be selected. System administrators use this table to configure or audit template deployments. Common reporting queries include listing all templates authorized for a given document type or identifying all document types where a specific template is used. A sample SQL pattern to retrieve this information is:

  • SELECT tut.template_id, tt.name template_name, tut.document_type, bdt.name doc_type_name FROM okc_template_usages tut, okc_terms_templates_all tt, okc_bus_doc_types_b bdt WHERE tut.template_id = tt.id AND tut.document_type = bdt.code AND bdt.language = USERENV('LANG');

Related Objects

OKC_TEMPLATE_USAGES is a central junction table with defined foreign key relationships to several key master data tables in the Contracts Core schema. As per the provided metadata, the documented relationships are:

  • OKC_TERMS_TEMPLATES_ALL: The table references OKC_TERMS_TEMPLATES_ALL via the TEMPLATE_ID column. This is the primary source table for contract terms templates.
  • OKC_BUS_DOC_TYPES_B: The table references OKC_BUS_DOC_TYPES_B via the DOCUMENT_TYPE column. This table defines the valid business document types within the Contracts module.
  • OKC_NUMBER_SCHEMES_B: The table references OKC_NUMBER_SCHEMES_B via the DOC_NUMBERING_SCHEME column. This table stores the definitions for document numbering sequences.

These relationships are fundamental to the integrity and configuration of the template-to-document type mapping within Oracle Contracts.