Search Results as_link_lead_opp_pub




Overview

AS_LINK_LEAD_OPP_PUB is the public PL/SQL package body owned by the APPS schema that governs the relationship between Oracle E-Business Suite sales leads and opportunities within the Oracle Sales (AS) product family. In the EBS 12.1.1 and 12.2.2 releases, this package exposes the supported, API-classified entry points that allow a qualifying sales lead to be converted into a sales opportunity, or to be associated with an existing opportunity. It is the external-facing counterpart to the private package AS_LINK_LEAD_OPP_PVT, and it coordinates calls into the lead and opportunity public APIs — AS_SALES_LEADS_PUB and AS_OPPORTUNITY_PUB — so that both the lead and opportunity records remain consistent after a linking or conversion action.

The package implements the standard EBS API contract through FND_API, returning a standard API return status and propagating messages via FND_MSG_PUB. Dependencies also include AS_LINK_LEAD_OPP_UHK, AS_SALES_LEAD_OPP_PVT, AS_UTILITY_PUB, AS_UTILITY_PVT, and JTF_USR_HKS, reflecting its role in enforcing user hooks, utility validations, and the underlying lead-to-opportunity data model.

Key Procedures and Functions

The documented package exposes four public procedures or functions:

  • GET_POTENTIAL_OPPORTUNITY — Retrieves the opportunity, or set of opportunities, that are candidates to be linked to a given lead. It supports the business rule that a lead may only be associated with opportunities that satisfy matching criteria, and is typically used to drive selection lists in the Sales application UI.
  • COPY_LEAD_TO_OPPORTUNITY — Copies the qualified content of a lead (for example its contact, customer, and qualification attributes) into an opportunity record. This supports the conversion workflow where an existing opportunity must be populated from lead data rather than created from scratch.
  • LINK_LEAD_TO_OPPORTUNITY — Establishes the association between an existing lead and an existing opportunity. It records the linkage so that the lead and opportunity remain related for tracking, reporting, and subsequent qualification activities.
  • CREATE_OPPORTUNITY_FOR_LEAD — Creates a new opportunity from a lead in a single API operation, effectively performing the end-to-end lead-to-opportunity conversion. This is the primary conversion entry point used when no suitable existing opportunity is available.

Parameter lists are intentionally not reproduced here; callers should reference the package specification and the Oracle Sales API documentation for the exact signatures.

Tables Accessed

The ETRM metadata for this package body does not enumerate explicit base tables; the documented dependencies are on other PL/SQL packages and on the APPS synonym layer. In practice, reads and writes are performed indirectly through AS_SALES_LEADS_PUB, AS_OPPORTUNITY_PUB, AS_SALES_LEAD_OPP_PVT, and AS_LINK_LEAD_OPP_PVT, which in turn manipulate the sales lead and opportunity tables (such as AS_SALES_LEADS and AS_OPPORTUNITIES) and the lead-opportunity association table. This indirection is deliberate: direct DML against these tables bypasses validation and is not supported.

Usage Notes

AS_LINK_LEAD_OPP_PUB is invoked from the Oracle Sales application forms when a user qualifies a lead or links it to an opportunity, and it may also be called from concurrent programs or custom extensions that automate lead conversion. Because it is a public API, custom code should call this package rather than the private AS_LINK_LEAD_OPP_PVT package or the underlying tables. Callers must initialize the FND_API global variables, check the returned API status, and retrieve messages using FND_MSG_PUB. The package is not referenced by any other database object, confirming its role as a top-level API intended for external invocation. Testing should be performed in a non-production environment, as conversion actions update core Sales data.