Search Results get_opp_defaults




Overview

OKC_OPPORTUNITY_PVT is a private PL/SQL package in the Oracle E-Business Suite Contracts (OKC) module, declared with AUTHID CURRENT_USER and owned by the APPS schema. It encapsulates the business logic required to generate and manage sales opportunities directly from contract data. In Oracle EBS 12.1.1 and 12.2.2, this package bridges the Contracts application with the opportunity-tracking and lead-management infrastructure provided by Oracle Sales / JTF (Java Technology Foundation) components, allowing contract records to seed opportunity headers and lines with defaulted probability and close-date values.

The package header carries the standard ETRM error-handling constants, including G_EXCEPTION_HALT_VALIDATION, G_UNEXPECTED_ERROR, G_SQLCODE_TOKEN, G_SQLERRM_TOKEN, G_PKG_NAME, and G_APP_NAME (inherited from OKC_API.G_APP_NAME). These support the standard message-stack return protocol (x_msg_data, x_msg_count, x_return_status) used throughout the public and private Contracts APIs.

Key Procedures and Functions

  • CREATE_OPPORTUNITY — The primary entry point for opportunity creation. It coordinates the header and line generation steps for a given contract, accepting win-probability and expected-close-days inputs and returning the resulting lead identifier along with the standard message-stack outputs.
  • CREATE_OPP_HEADER — Creates the opportunity header record associated with a contract. It accepts the same win-probability and expected-close-days parameters and returns the lead identifier.
  • CREATE_OPP_LINES — Creates the opportunity line records, taking the contract identifier and the lead identifier generated by the header step, and populating the message-stack outputs.
  • IS_OPP_CREATION_ALLOWED — A validation routine that evaluates whether opportunity creation is permitted for the specified contract, returning the standard return status to signal eligibility.
  • GET_OPP_DEFAULTS — Supplies default values for opportunity attributes. It accepts a context and contract identifier and returns, as IN OUT NOCOPY parameters, the win probability and the closing-date-days defaults. This is the procedure most frequently referenced when searching for "get_opp_defaults", since it is the mechanism by which the opportunity form or calling code pre-populates default probability and closing horizon values.

Tables Accessed

The package reads and writes a broad set of Contracts and JTF tables through APPS synonyms. Contract core tables include OKC_K_HEADERS_B, OKC_K_LINES_B, OKC_K_ITEMS, OKC_K_PARTY_ROLES_B, OKC_K_REL_OBJS, OKC_CONTACTS, OKC_RULES_B, OKC_STATUSES_B, and OKC_SUBCLASSES_B, which provide the contract header, line, party, relationship, rule, and status context for opportunity generation. JTF tables JTF_OBJECT_USAGES and JTF_RS_SALESREPS support opportunity object association and sales representative linkage. MTL_CATEGORIES_B and MTL_ITEM_CATEGORIES supply item category information for line creation, while FND_ID_FLEX_STRUCTURES and PLITBLM are referenced for descriptive-flexfield and internal PL/SQL table handling.

Usage Notes

OKC_OPPORTUNITY_PVT is a private (PVT) package and is not intended for direct invocation by external customizations; it is called by the public Contracts APIs and by the Contracts forms and concurrent programs that manage contract-based opportunity creation. Because it is referenced by one other documented package, changes to its interface may ripple into that dependent code. Custom code requiring opportunity creation should generally invoke the corresponding public OKC API rather than this private package. When extending or debugging, note that the defaulting behavior sought by the "get_opp_defaults" search is contained in GET_OPP_DEFAULTS, which drives form-level defaulting of win probability and closing dates.