Search Results get_last_message




Overview

APPS.XDP_ERRORS_PKG is the centralized error-logging and error-retrieval utility package within the Oracle E-Business Suite "XDP" module (the Oracle E-Records / Electronic Records framework used by Oracle Approvals Management, Oracle Learning Management, and related product families). Its core business purpose is to capture runtime error conditions raised by other XDP components into a persistent log so that diagnostics, workflow error messages, and user-facing notifications can be produced consistently. Rather than each calling program inventing its own logging mechanism, XDP_ERRORS_PKG provides a single, standardized API surface: it resolves a message name against the FND message dictionary, stores the resolved parameters and timestamp, and later allows a caller to retrieve the last recorded message for display or escalation. In Oracle EBS 12.1.1 and 12.2.2 the package ships as an APPS-owned database object, classified in ETRM as OTHER. It is referenced by seven other packages, confirming its role as a shared utility rather than an end-user-facing API.

Key Procedures and Functions

  • SET_MESSAGE — The primary insert routine. It validates that object type, object key, and message name are supplied, resolves the message text via FND_MESSAGE.GET_STRING against the XDP application, sanitizes the parameter string, and writes a row to the error log with the current user and login identifiers. It handles unexpected exceptions internally by rolling back and delegating to xdp_utilities.generic_error.
  • SET_MESSAGE_AUTO — A companion setter intended for automatic (non-interactive) logging, allowing the error type to be supplied or defaulted for system-generated errors.
  • LOG_WF_ERROR — Records errors originating from Oracle Workflow, associating the failure with a workflow item type, item key, and activity identifier so that workflow administrators can trace the failed process.
  • GET_LAST_MESSAGE — Retrieves the most recently logged message, typically for presentation back to the user or for inclusion in a subsequent exception or notification. This is the procedure most commonly referenced by developers searching for "get_last_message."
  • GET_MESSAGE — Resolves and returns stored message text, subject to the documented 2000-character limitation imposed by FND_MESSAGE.GET.
  • UPDATE_ERROR_COUNT — Maintains the aggregate error counter, incrementing or adjusting the tally retained for a given object.
  • GET_ERROR_COUNT — Returns the accumulated error count, enabling callers to branch logic, suppress duplicates, or trigger escalation when thresholds are exceeded.

Tables Accessed

The package operates against three documented tables, all referenced through APPS synonyms. XDP_ERRORS_S is the sequence supplying unique ERROR_ID values for each logged entry. XDP_ERROR_LOG is the principal target of insert activity, holding object type, object key, error timestamp, message name, message parameters, error type, and the standard WHO audit columns (CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, LAST_UPDATE_LOGIN). XDP_ERROR_COUNT stores aggregated error tallies manipulated by UPDATE_ERROR_COUNT and queried by GET_ERROR_COUNT, providing a lightweight alternative to scanning the full log.

Usage Notes

XDP_ERRORS_PKG is invoked programmatically rather than through a dedicated form. Typical callers are other XDP packages, Oracle Forms-based transactions, concurrent programs, and workflow background processes that need durable error capture. The standard pattern is to call SET_MESSAGE or SET_MESSAGE_AUTO inside an exception handler, then retrieve the stored text with GET_LAST_MESSAGE or GET_MESSAGE for display. Developers should note the documented constraint that message text must not exceed 2000 characters and must not contain chr(0), since FND_MESSAGE.GET fails on such input. Because the package commits via FND_GLOBAL context values, callers must ensure the session user and login identifiers are properly initialized before logging.