Search Results insert_optrules




Overview

The APPS.OKL_SETUPOPTRULES_PUB package body is a public PL/SQL API within the Oracle E-Business Suite Lease Management (OKL) module—part of the ETRM (Enterprise Trade and Risk Management) application family. It exposes setup-related option rule operations to external callers, including Oracle Forms, concurrent programs, and custom extensions. In Oracle EBS 12.1.1 and 12.2.2, this package follows the standard multi-tier API architecture: a public layer (_PUB) that handles API versioning, message list initialization, and standardized return-status conventions, delegating the actual business logic to a corresponding private layer (OKL_SETUPOPTRULES_PVT).

The package is classified under the API standard as PUB, indicating it is a supported, externally callable interface. The primary business function is the creation and maintenance of option rules that govern how lease or financing options behave during contract setup. The user search for delete_optrules maps directly to one of the documented procedures in this package.

Key Procedures and Functions

The documented package exposes three procedures:

  • GET_REC — A query routine that retrieves a single option rule record from the OKL_OPT_RULES_V view. It accepts record-type input, returns a corresponding record structure, reports success or failure via x_return_status, and sets x_no_data_found when no matching row exists. Internally it delegates to OKL_SETUPOPTRULES_PVT.GET_REC and raises FND_API.G_EXC_UNEXPECTED_ERROR on unexpected failure.
  • INSERT_OPTRULES — The public wrapper for the insert-optrules process API. It accepts API version information, an initialization flag, and record-type parameters (p_optv_rec, p_orlv_rec) and returns the resulting option rule record along with standard message count and message data outputs.
  • DELETE_OPTRULES — The delete-optrules process API, which removes an option rule setup record. This is the procedure targeted by the user's search term. It follows the same public-wrapper convention as the insert routine, applying consistent validation, message handling, and return-status semantics.

Tables Accessed

The metadata does not enumerate explicit table references, though the code excerpt clearly references the view OKL_OPT_RULES_V, which is the source for GET_REC. This view surfaces option rule data underlying the setup configuration. The insert and delete operations manipulate the base option-rules table through the private package layer. Because the documented table list is not provided, callers should treat the option-rules entity as the primary persistent object, with access mediated by APPS synonyms.

Usage Notes

This package is typically invoked from Lease Management setup forms, from concurrent programs that bulk-load option rule configurations, and from custom PL/SQL that integrates lease options with external systems. It is referenced by one other package, indicating integration within a broader setup API cluster.

Standard calling conventions apply: callers should pass a valid p_api_version, honor the p_init_msg_list flag, and inspect x_return_status for FND_API.G_RET_STS_SUCCESS, G_RET_STS_ERROR, or G_RET_STS_UNEXP_ERROR. Because the public layer is a wrapper, error text is retrieved via FND_MESSAGE.GET, and unexpected errors are surfaced through the standard FND exception mechanism. Direct DML against option rule tables should be avoided in favor of these APIs to preserve validation and auditing integrity.