Search Results get_territory_code




Overview

APPS.JTA_SYNC_COMMON is a shared utility package body in the Oracle E-Business Suite (EBS) Release 12.1.1 and 12.2.2 environments. It is a component of the Oracle Telephony / Territory Management synchronization framework associated with the JTA (Sales and Telephony) schema. Its declared purpose, as stated in the package header, is to implement "commonly used procedures and functions" invoked across the JTA synchronization modules. Rather than duplicating low-level lookups and message handling logic in each synchronization routine, this package centralizes them, so it is classified in the ETRM metadata as an OTHER-type API rather than a public business API. The package is referenced by three other packages, confirming its role as an internal shared resource. The most recent header revision shown is 120.4 dated 2006/04/12, and the change log records that get_territory_code was added on 27-Feb-2002 — the function tied directly to the user search term.

Key Procedures and Functions

The ETRM metadata documents nine procedures and functions:

  • GET_SEQID — Returns a unique sequence identifier by retrieving the next value of the jta_sync_contact_mapping_s sequence. It supplies surrogate keys to callers performing contact mapping inserts.
  • IS_SUCCESS — Accepts a return status and converts it into a Boolean, evaluating whether the value equals fnd_api.g_ret_sts_success. It standardizes success checks on FND API results.
  • PUT_MESSAGES_TO_RESULT — Loads FND messages by name and appends the resolved message text, separated by line breaks, into the result user message field of a task record. It accumulates the FND message stack into the JTA sync task output.
  • GET_USERID — Resolves and returns the FND user identifier, added in the 12-Feb-2002 revision.
  • GET_RESOURCEID — Resolves and returns the resource identifier, relating to the resource extensions records named in the table list.
  • GET_TIMEZONEID — Resolves and returns the time zone identifier used when recording synchronization timestamps.
  • GET_MESSAGES — Retrieves accumulated FND messages for reporting or logging by the calling synchronization routine.
  • GET_TERRITORY_CODE — Added 27-Feb-2002, this function resolves a territory code, drawing on the FND_TERRITORIES_TL translation table. It is the lookup used by the user's search query.

Tables Accessed

Access to all referenced objects is through APPS synonyms. The package reads FND_TERRITORIES_TL for territory code resolution in GET_TERRITORY_CODE; FND_USER for user identification in GET_USERID; HZ_TIMEZONES for time zone data in GET_TIMEZONEID; and JTF_RS_RESOURCE_EXTNS for resource identification in GET_RESOURCEID, likely joined with JTF_RS_RESOURCE handling logic. It reads the JTA_SYNC_CONTACT_MAPPING_S sequence in GET_SEQID, and selects from DUAL for sequence retrieval. The package performs read-only lookups against these dictionary and reference tables; the only write-oriented behavior is the accumulation of messages into the caller-supplied task record and the advancement of the sequence.

Usage Notes

JTA_SYNC_COMMON is an internal support package rather than an end-user API. It is invoked programmatically by the JTA synchronization packages that reference it, including contact synchronization and territory assignment processing. Applications of GET_TERRITORY_CODE typically arise when a synchronization routine must translate an internal territory identifier into a displayable or reportable territory code. CALLERS should invoke these routines within the same database session as the parent synchronization activity, because PUT_MESSAGES_TO_RESULT and GET_MESSAGES rely on the session-level FND message stack populated via fnd_msg_pub. Because the GET_* functions are simple cached-lookup style resolvers, custom code should call them rather than re-querying FND_TERRITORIES_TL, FND_USER, or HZ_TIMEZONES directly, ensuring consistent interpretation of identifiers. Any modifications should be treated as an upgrade-sensitive customization, since the package has been shipped since early 11i and remains present in 12.2.2.