Search Results create_or_update_block




Overview

APPS.HR_ATTACHMENTS_LOADER is an Oracle E-Business Suite PL/SQL package that provides the programmatic infrastructure for creating and configuring attachment (document) functionality within Oracle EBS forms. Rather than a business-facing API for attaching documents to individual records, this package operates at the metadata/configuration layer: it registers attachment functions, associates document categories, defines attachment blocks, registers document entities, and binds entities to blocks. In the Oracle EBS architecture, attachments rely on a set of FND foundation tables (FND_ATTACHMENT_FUNCTIONS, FND_ATTACHMENT_BLOCKS, FND_DOCUMENT_ENTITIES, and related seeded/translation tables) that tell the Forms runtime which blocks expose the attachment paperclip and which entity keys the attachments are tied to. This package encapsulates the manipulation of those foundation records, so that a form or setup program can be enabled for attachments without manually inserting rows into the underlying FND tables. The package is declared with AUTHID CURRENT_USER, and the header carries a legacy identifier (hratload.pkh, version 115.1), indicating it originated in the Oracle HRMS application family, consistent with the HR_ prefix. It is classified as an "OTHER" API in the ETRM documentation, is not itself an entity-attachment API, and is referenced by zero other packages, meaning it is intended to be invoked directly rather than being a building block for higher-level attachment APIs.

Key Procedures and Functions

The package exposes five documented procedures, several of which contain the requested create_or_update_block routine:

  • CRE_OR_SEL_ATT_FORM_FUNCTION — Creates or selects an attachment form function. It accepts a function name and function type as input and returns the attachment function identifier and application identifier, establishing the form-level anchor to which attachment blocks and categories are subsequently attached.
  • ASSOCIATE_CATEGORY — Associates a document category with a given attachment function, tying a category definition to the form function so that users can select it during attachment of documents.
  • CREATE_OR_UPDATE_BLOCK — Creates or updates an attachment block definition for a given attachment function. It takes the attachment function identifier and block name along with optional querying, security, and context field parameters, and returns the attachment block identifier. This is the procedure invoked when a form block must be registered or refreshed as an attachment-enabled block.
  • CREATE_OR_SELECT_ENTITY — Creates or selects a document entity, taking a data object code and optional user name, language, application, table, entity name, and primary key column names, and returns the document entity identifier. This registers the underlying entity that attachments belong to.
  • ATTACH_ENTITY — Binds a document entity to an attachment block, supplying the display method, inclusion/indicator flags, primary key fields, and related parameters. This is the final linkage that makes an entity attachable through a specific block in a form.

Tables Accessed

The package reads and writes the FND attachment and document-entity foundation tables through APPS synonyms: FND_ATTACHMENT_FUNCTIONS and its _S shadow table store the attachment form function definitions created by CRE_OR_SEL_ATT_FORM_FUNCTION. FND_ATTACHMENT_BLOCKS and FND_ATTACHMENT_BLOCKS_S hold block definitions managed by CREATE_OR_UPDATE_BLOCK. FND_DOCUMENT_ENTITIES, FND_DOCUMENT_ENTITIES_S, and FND_DOCUMENT_ENTITIES_TL hold entity registrations (and translated names) produced by CREATE_OR_SELECT_ENTITY. FND_ATTACHMENT_BLK_ENTITIES and FND_ATTACHMENT_BLK_ENTITIES_S store the block-to-entity bindings created by ATTACH_ENTITY. FND_DOC_CATEGORY_USAGES and FND_DOC_CATEGORY_USAGES_S record category associations established by ASSOCIATE_CATEGORY. The _S tables provide the standard EBS date-tracked history used for localization and auditing consistency.

Usage Notes

HR_ATTACHMENTS_LOADER is typically invoked from Oracle Forms-based setup code, form-level triggers, or custom PL/SQL that programmatically configures attachment metadata rather than from concurrent programs. Developers use it when building or extending a form that must support attachments, calling CRE_OR_SEL_ATT_FORM_FUNCTION to register the form function, CREATE_OR_UPDATE_BLOCK to define the attachment block, CREATE_OR_SELECT_ENTITY to register the entity, and ATTACH_ENTITY to bind them. Because it references the same foundation tables as the standard Application Developer attachment setup screens, changes are reflected in the normal Attachments configuration. Care should be taken: the procedures modify seeded FND metadata, so they should be run only during controlled setup, with validation of function names, block names, and entity codes, and in Oracle EBS 12.1.1 and 12.2.2 the behavior is consistent though the underlying FND table structures follow the respective release schemas. Since no other package references it, callers must depend on it directly.