P. 1
TCAAPIEX(1)

TCAAPIEX(1)

|Views: 156|Likes:
Published by Taha Nakhleh

More info:

Published by: Taha Nakhleh on May 13, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

07/03/2013

pdf

text

original

Sections

  • INTRODUCTION TO API
  • API Components
  • Advantages of Using TCA API
  • FEATURES OF TCA API
  • Exception Handling and Results Messages
  • Messages
  • Robust Validation
  • Locking Mechanism
  • Debug Messages (PL/SQL API)
  • IDENTIFICATION OF THE PACKAGE NAME AND VERSION OF AN API
  • UPLOADING DATA USING API
  • APIS AVAILABLE FOR TRADING COMMUNITY ARCHITECTURE Party APIs
  • EXAMPLE ON RUNNING TCA API
  • Example 1 : Running The Create Organization API
  • General Tips for Running the Create Organization API
  • Example 2 : Running The Create Person API
  • Example 3 : Running The Create Group API
  • Example 4 : Create Org Contact API
  • Example 5 : Create Location API
  • Example 6 : Update Location API
  • Example 7 : Create Party Site API
  • Example 8 : Create Party Site Use API
  • Example 9 : Create Party Site API
  • Example 10 : Create Relationship Type API
  • Example 11 : Create Relationship API
  • Example 12 : Create Class Category API
  • Example 13 : Create Code Assignment API
  • Example 14 : Create Customer Account API
  • Example 15 : Update Customer Account API
  • Example 16 : Create Customer Account API
  • Example 17 : Update Customer Account Site Use API
  • Example 18 : Create Customer Profile API
  • Example 19 : Update Customer Profile API
  • Example 20 : Create Location Assignment API
  • PL/SQL RECORD STRUCTURES USED BY TCA APIS
  • PL/SQL Record Structure for Organization
  • PL/SQL Record Structure for Person
  • PL/SQL Record Structure for Group
  • PL/SQL Record Structure for Organization Contact
  • PL/SQL Record Structure for Location
  • PL/SQL Record Structure for Party Site
  • PL/SQL Record Structure for Party Site Use
  • PL/SQL Record Structure for Contact Point
  • PL/SQL Record Structure for Phone
  • PL/SQL Record Structure for Create Relationship Type API
  • PL/SQL Record Structure for Create Relationship API
  • PL/SQL Record Structure for Create Class Category API
  • PL/SQL Record Structure for Create Code Assignment API
  • PL/SQL Record Structure for Customer Account
  • PL/SQL Record Structure for Customer Account Site
  • PL/SQL Record Structure for Customer Account Site Use
  • PL/SQL Record Structure for Create Customer Profile API
  • MESSAGES FOR THE TCA API

Using TCA APIs Including Examples – V2

An Oracle White Paper May 2002

Author Creation Date Last Updated Version

: Viswanathan Rajagopalan : April 2002 : May 2002 : 1.0

Using TCA APIs including Examples – V2

Introduction To API .........................................................................................3 API Components...........................................................................................4 Advantages of Using TCA API...................................................................4 Features of TCA API ........................................................................................5 Exception Handling and Results Messages ...............................................5 Messages .........................................................................................................5 Robust Validation..........................................................................................6 Locking Mechanism ......................................................................................6 Debug Messages (PL/SQL API) ................................................................7 Location of API in Oracle Applications DirectoryError! Bookmark not defined. Identification of the Package Name and Version of an API.................... 10 Uploading Data Using API............................................................................ 10 APIs Available For Trading Community Architecture ............................. 11 Example on running TCA API..................................................................... 13 Example 1 : Running The Create Organization API ............................ 13 Example 2 : Running The Create Person API ....................................... 16 Example 3 : Running The Create Group API........................................ 19 Example 4 : Create Org Contact API...................................................... 22 Example 5 : Create Location API ............................................................ 26 Example 6 : Update Location API........................................................... 29 Example 7 : Create Party Site API ........................................................... 32 Example 8 : Create Party Site Use API ................................................... 35 Example 9 : Create Party Site API ........................................................... 37 Example 10 : Create Relationship Type API.......................................... 41 Example 11 : Create Relationship API................................................... 45 Example 12 : Create Class Category API................................................ 50 Example 13 : Create Code Assignment API .......................................... 53 Example 14 : Create Customer Account API ........................................ 57 Example 15 : Update Customer Account API....................................... 61 Example 16 : Create Customer Account API ........................................ 64 Example 17 : Update Customer Account Site Use API ....................... 67 Example 18 : Create Customer Profile API ........................................... 70 Example 19 : Update Customer Profile API.......................................... 73 Example 20 : Create Location Assignment API .................................... 76 PL/SQL Record Structures Used by TCA APIs ....................................... 79 PL/SQL Record Structure for Organization ......................................... 79 PL/SQL Record Structure for Person .................................................... 82 PL/SQL Record Structure for Group..................................................... 83 PL/SQL Record Structure for Organization Contact .......................... 83

Documentation on using TCA APIs - V2

Page 1

PL/SQL Record Structure for Location................................................. 84 PL/SQL Record Structure for Party Site................................................ 86 PL/SQL Record Structure for Party Site Use........................................ 87 PL/SQL Record Structure for Contact Point........................................ 87 PL/SQL Record Structure for Phone ..................................................... 88 PL/SQL Record Structure for Create Relationship Type API............ 88 PL/SQL Record Structure for Create Relationship API...................... 89 PL/SQL Record Structure for Create Class Category API.................. 90 PL/SQL Record Structure for Create Code Assignment API ............ 91 PL/SQL Record Structure for Customer Account............................... 91 PL/SQL Record Structure for Customer Account Site ....................... 93 PL/SQL Record Structure for Customer Account Site Use ............... 95 PL/SQL Record Structure for Create Customer Profile API ............. 97 Messages for the TCA API.......................................................................... 100

Documentation on using TCA APIs - V2

Page 2

Oracle will not be able to support them. or through a front end such as the Data Pump. a Third party Personnel system into Oracle Receivables. User can modify application information without being aware of every feature of the database structure. The APIs available in Oracle Receivables have been written to fulfill business needs like Create Customer.Uploading data via ADE.Using TCA APIs including Examples – V2 INTRODUCTION TO API Application Programming Interface (API) is a PL/SQL packaged procedure which can be used as an alternative to traditional Application online form. the API is not executed on its own. The API package should never be modified for specific custom use. PL/SQL Public API . modify. by a direct SQL*Plus call. If user needs additional functionality.Regular interface from. Continuous utilization of APIs helps to protect customer-specific data from database structural changes. c) Spreadsheets . Documentation on using TCA APIs .V2 Page 3 . While the API package contains many procedures to insert. the APIs can be modified to those same structural changes so that data can continue to be modified without any error or need to update coding. APIs can be used as building blocks. JAVA Public API and Forms API are the three categories of APIs. standard or web forms. and can be used in many other ways like : a) Data Uploads . Using APIs give users an advantage of adding data to the system is that user can enter new information or alter existing data without entering information manually into the application.standard interface.Bulk transfer of data from an existing system into Oracle Receivables. Update Customer Contact etc. by other pl/sql modules. As the table structures changes. It also depends on the API to update all the interrelated tables. The API must be called. The discussion in this document will be on PL/SQL V2 Public API for TCA. d) Forms . for example. to be called within a more extensive package that user may build to address the unique functionality desired. b) Interfacing . APIs insures the integrity of the interrelationship of Oracle Applications tables. or delete application data. or executed. If modified.

INTRODUCTION TO TCA API The TCA API is an integrated set of code designed in a highly modular fashion.V2 Page 4 . maintain and extend. Customers. consultants. organization. A new locking mechanism based on the OBJECT_VERSION_NUMBER field. and Oracle internal development teams can use Version 2 of the public TCA application programming interfaces (APIs). easy to understand and modular. The modular approach defaults and validates users who enter infromation. Extensive error handling and reporting capability. The Trading Community Architecture (TCA) datamodel is the foundation for the 11i Oracle e-Business Suite of Applications via PL/SQL APIs. which has been included in all of the HZ entities for which the public APIs have been provided. Version 1 of the APIs are only made available to Oracle internal development teams. These APIs (version 2) will be supported for use by customers and consultants and are available for use by internal product teams in ERP and CRM. defauts information not provided by the user and calls the appropriate entity handler to perform the business related tasks. This is a step forward from the version 1 APIs that are available only for use by internal product teams. role responsibility Customer profile and customer profile amount Documentation on using TCA APIs . Robust validation in all of the APIs. API Components · · · · · · · · · · · · API category PL/SQL package PL/SQL record structure PL/SQL procedure Parameter description Validations Flexible. Extensive debugging capability. resulting in code that are easy to understand.person. organization contact role · Contact points · Contact preferences · Relationship types · Relationships · Classification · Customer accounts · Account sites and site uses · Customer account role. Standard signature and availability of common parameters Advantages of Using TCA API The following main categories of entities are covered : · Parties . group · Locations · Party sites. The Version 2 Public API feature is available from HZ Patchset E. party site use · Organization contact.

G_RET_STS_UNEXP_ERROR (PL/SQL API) An unexpected error status indicates that the API encounteres an unexpected error condition that it could not handle. memory errors and programming errors such as attempting to divide by zero. Messages The APIs put result messages into a message list. Examples of such errors are irrecoverable data inconsistency errors. user should be able to correct normal. In this case. With the message dictionary. In most cases. G_RET_STS_ERROR (PL/SQL API) An error return status indicates that the API failed to perform some or all the operations requested by its caller. There are three types of information that the TCA APIs provide to their calling programs: · Overall status · Messages describing the operations performed or errors encountered by the API · Output values that the program making the call to the API might need to use Return Status The return status (x_return_status) of the API informs the caller about the result of the operation or operations performed by the API. The return status values are: Success FND_API. loading them into a database table. For more information. The calling program has the option of displaying all the error messages or the first error message on the stack. Programs calling these APIs can then get the messages from the list and process those messages by issuing them. Documentation on using TCA APIs . the error is displayed as one of the output parameters of the API routine. If there is only one error in the message stack. User need not fetch that message from the stack. or writing them to a log file. expected errors such as missing attributes or invalid date ranges. An error return status is usually accompanied by messages describing any errors and how to resolve them. Failure FND_API. The errors that are encountered in the different phases of the API execution are reported and put on the message stack. users can store these messages in database tables and generate reports from these tables in different languages. G_RET_STS_SUCCESS (PL/SQL API) A success return status indicates that the API performed all the operations requested by its caller. an end user is unable to correct unexpected errors.FEATURES OF TCA API Exception Handling and Results Messages The APIs provide an extensive set of error-handling and error-reporting mechanisms. the API cannot continue its regular processing. The APIs store messages in an encoded format so that the API callers can use standard functions provided by the message dictionary to find message names. see List of Messages.V2 Page 5 . A success return status can be accompanied by informative messages in the API message list. In most cases. Unexpected Error FND_API. These errors usually require resolution by a system administrator or an application developer.

Documentation on using TCA APIs .Get.Count_Msg (or standard output parameter x_msg_count) and FND_MSG_PUB. OBJECT_VERSION_NUMBER is a mandatory attribute for all update APIs. The parameters below are common to all of the APIs. OUT Parameters The names of all output parameters begin with x_. Robust Validation The TCA APIs perform robust validations. for the hz_party_v2pub. which has been included in all HZ tables. The initialization must only be done once in the case where more than one API is being called. Standard Parameters and Missing Attributes (PL/SQL API) The TCA APIs have been developed to conform to the Oracle Applications API standards. the value in the OBJECT_VERSION_NUMBER column is reset to OBJECT_VERSION_NUMBER plus 1. Brief descriptions are provided for some of the important features of the API. If it set to false.initialize to initialize the message stack. For example.G_FALSE. see Sample Code.update_organization API. An error will be returned if the calling program passes an object version number that is not identical to the one in the database for the existing record. the API sets the value in the OBJECT_VERSION_NUMBER column to null. the API calls fnd_msg_pub. The locking mechanism works as follows: · Whenever a new record is created. Locking Mechanism The TCA public APIs provide a new locking mechanism for update procedures.The API message list must be initialized every time a program calls an API. or request that the API do the initialization by setting the p_init_msg_list parameter to T (TRUE). p_init_msg_list IN VARCHAR2 Optional The default is FND_API. the value in the OBJECT_VERSION_NUMBER column is set to 1. Standard Parameters IN or IN/OUT Parameters p_<entity>_object_version_number IN/OUT NUMBER Required This parameter is either called p_object_version_number or p_<entity>_object_version_number. For this reason. The APIs collect all the validation errors encountered and put them on the message stack. then the calling program must initialize the message stack.Initialize. The parameter value must match the version number in the database of the record being updated. The program calling the API can retrieve messages from the message stack using the existing FND API functions FND_MSG_PUB. based on the new OBJECT_VERSION_NUMBER column. FND_MSG_PUB. If set to true. · Whenever a record is updated. API callers can either call the message list utility function. For examples of these functions.V2 Page 6 . The relevant entity handler is called only if no errors are reported during the validation phases. · For records that existed in the HZ tables prior to introduction of this locking mechanism. this parameter is called p_party_object_version_number because organization is a type of party.

'j') .Expected error. validation or missing data FND_API. These are pre-defined values in the FND_API Package (fndapis.V2 Page 7 .G_MISS_CHAR for VARCHAR2 type. The returned value is one of the following : x_msg_count OUT NUMBER x_msg_data OUT VARCHAR2 FND_API. the p_person_rec input parameter is of the person_rec_type record type. For example. nested record types have been used as well. the Create APIs handle exceptions to the unique key violation.G_RET_STS_UNEXP_ERROR . Missing Attributes Optional IN parameters do not have default values. then the x_msg_data column holds the encoded message. These messages can be written to a log file as well. · FND_API. The reason for doing this is that the attributes of the Person party type include attributes of a party.Success FND_API. These debugging messages are useful because an API would be difficult to debug otherwise. · FND_API.99E125 · G_MISS_CHAR CONSTANT VARCHAR2(1):= chr(0) · G_MISS_DATE CONSTANT DATE:= TO_DATE('1'.HZ: Turn On File Debug Documentation on using TCA APIs . User can turn on debug messages with a certain profile option. based on the data type of the attribute. · FND_API. Nested Record Types PL/SQL record types have been used in all of the create and update APIs. then the database retains the existing value.HZ_API_FILE_DEBUG_ON · User Profile Name .G_RET_STS_ERROR . in the Create_Person API.Unexpected error. which itself is of party_rec_type record type. In order to prevent duplicate primary keys. Debug Messages (PL/SQL API) Use the extensive debug messages to troubleshoot in case of unexpected problems. which can be generated on a device from an Oracle Mobile application. For an Update API. if a particular attribute value is not passed into the API. because Person is a subtype of Party. The profiles for controlling the debug mechanism are: · Name . If the count is one. cannot be corrected by the calling program The x_msg_count column contains the number of messages in the message list. In some cases.G_RET_STS_SUCCESS . the calling program must explicitly set the attribute value to one of the following constants.G_MISS_NUM for NUMBER type. Primary Key Generation The Create APIs handle both sequence-generated and manually-passed primary keys. An attribute value that is not passed in is assumed to have a default of null for a Create API. The person_rec_type has party_rec as one of its elements.x_return_status OUT VARCHAR2(1) The Out parameter returns the status of the API.pls) · G_MISS_NUM CONSTANT NUMBER:= 9.G_MISS_DATE for DATE type. In order to set a database value to null.

ora for the relevant database. Follow the same strategy for dbms debug mode. user must reset the HZ_API_FILE_DEBUG_ON profile back to N.put('HZ_API_DEBUG_FILE_PATH'. respectively. Documentation on using TCA APIs . If user turn the file debug mode on. From SQLPLUS set serveroutput on exec fnd_profile. User should only use the HZ_API_DBMS_DEBUG_ON profile during the development phase or in SQLPLUS because of limitation of dbms_output. but did not set a proper value for the HZ_API_DEBUG_FILE_PATH profile or the HZ_API_DEBUG_FILE_NAME profile is null. exec fnd_profile.put('HZ_API_FILE_DEBUG_ON'. 'Y'). If the HZ_API_FILE_DEBUG_ON profile is set to N. 'api_debug').put('HZ_API_DEBUG_FILE_PATH'. From PL/SQL code fnd_profile. 'Y').· · · · · · Name . then debug messages are written to the file specified in HZ_API_DEBUG_FILE_PATH and HZ_API_DEBUG_FILE_NAME. 'Y'). /sqlcom/out/tca115. If user do not. as provided in init. user must set the proper values for the HZ_API_DEBUG_FILE_NAME and HZ_API_DEBUG_FILE_PATH profiles. This example assumes that the directory. no debug messages are generated. Debug messages accumulate in the debug file.HZ_API_DEBUG_FILE_PATH User Profile Name . The default value is N.put('HZ_API_FILE_DEBUG_ON'.put('HZ_API_DEBUG_FILE_NAME'. but be sure to use the set serveroutput on option.ora. system might cause an exceeded file size error. From PL/SQL set serveroutput on fnd_profile.put('HZ_API_DBMS_DEBUG_ON'. If the HZ_API_FILE_DEBUG_ON profile is set to Y when any APIs are called.HZ_API_DBMS_DEBUG_ON User Profile Name . '/sqlcom/out/tca115/'). has write access that is specified by the utl_file_dir parameter in the init. fnd_profile. After collecting any debug messages. The value of the HZ_API_DEBUG_FILE_PATH profile specifies a directory file path that the database has write access to. User can find path information by querying: select value from v$parameter where name equals utl_file_dir. From SQLPLUS exec fnd_profile. fnd_profile. With SQLPLUS or server side PL/SQL custom code .put('HZ_API_DEBUG_FILE_NAME'. exec fnd_profile. the API errors out.HZ: API Debug File Name Name . 'api_debug').V2 Page 8 . There are two ways to run APIs in the debug mode: From Oracle Applications the debug mode can be enabled or disabled by setting HZ_API_FILE_DEBUG_ON to Y or N. 'Y').put('HZ_API_DBMS_DEBUG_ON'.HZ: API Debug File Directory Name .HZ: Turn On Development Debug.HZ_API_DEBUG_FILE_NAME User Profile Name . When the profile is set Y.user can enable or disable the debug mode by calling FND_PROFILE API. '/sqlcom/out/tca115/').

This debug strategy is provided as a public utility procedure that can include in custom code. Refer to the HZ_UTILITY_PUB package for further details.

The following portion of the document will discuss about using V2 Public TCA APIs which are available both to the users and the internal development team.
Some Salient Features of the V2 Public APIs

Flexible, easy to understand, modular with new API signatures as compared to V1 version of the APIs, that is after a major data model cleanup project several attributes from the API signatures that are obsolete and have not been used in a consistent manner were eliminated. Appropriate data migration has also been provided. · Major Performance Improvements over the previous version of the APIs · API Hooks using the new Business Event System (BES) provided by Application Technology Group · New Locking Mechanism based in an OBJECT_VERSION_NUMBER field that has been included in all the HZ entities for which the V2 APIs are provided · An extensive error handling and reporting capability · An extensive debugging capability that was not available in the V1 version of the APIs · V2 APIs are now PUBLIC, that is, Will be supported by World Wide Support. Customers and consultants can now use these APIs and log tars/bugs to get support on these which was not possible with the V1 version of the APIs The following are main categories of entities that are covered in TCA APIs : · Parties - Person, Organization, Relationship, Group. · Locations, Party Sites, Party Site Uses · Contact Points, Contact Preferences · Customer Accounts, Account Sites and Site Uses · Classification · Relationships · Relationship, Relationship types and Groups

Documentation on using TCA APIs - V2

Page 9

IDENTIFICATION OF THE PACKAGE NAME AND VERSION OF AN API

To identify the package name of an API as compiled into the Oracle database, in SQL*Plus enter the following select statement (logged in as APPS) sql>SELECT text FROM all_source WHERE name like '%user_api_name%' (example: HZ_CUSTOMER_ACCOUNT_PUB API) AND text like '%Header%'; A header line of the package and package body showing the package name and version number is returned. To compare the version of the API package in user’s operating system directory to the one compiled in user’s database, execute the following from the command line from the API directory: prompt>strings -a packagename | grep Header All occurrences of the package, package body, and the version number of the file. Version numbers should match what is compiled in the database.
UPLOADING DATA USING API

While the API package contains many procedures to insert, modify, or delete application data, the API is not executed on its own. The API must be called, or executed, by other PL/SQL modules, by a direct SQL*Plus call, or through a front end such as the Data Pump. The API package should never be modified for specific custom use. If modified, Oracle will not be able to support them. If user need additional functionality, APIs can be used as building blocks, to be called within a more extensive package that user may build to address the unique functionality desired.

Documentation on using TCA APIs - V2

Page 10

APIS AVAILABLE FOR TRADING COMMUNITY ARCHITECTURE Party APIs · Create Organization API · Update Organization API · Create Person API · Update Person API · Create Group API · Update Group API Party Contact APIs · Create Org Contact API · Update Org Contact API · Create Org Contact Role API · Update Org Contact Role API Person Info API · Create Person Language API · Update Person Language API Location API · Create Location API · Update Location API Party Site API · Create Party Site API · Update Party Site API · Create Party Site Use API · Update Party Site Use API Contact Point API · Create Contact Point API · Update Contact Point API Relationship Type API · Create Relationship Type API · Update Relationship Type API Relationship API · Create Relationship API · Update Relationship API Classification APIs · Create Class Category API · Update Class Category API · Create Class Code Relation API · Update Class Code Relation API · Create Code Assignment API · Update Code Assignment API

Documentation on using TCA APIs - V2

Page 11

· · Create Class Category Use API Update Class Category Use API Contact Preference API · Create Contact Preference API · Update Contact Preference API Customer Account APIs · Create Customer Account API (Person or Organization) · Update Customer Account API · Create Customer Account Relationship API · Update Customer Account Relationship API Customer Account Site APIs · Create Customer Account Site API · Update Customer Account Site API · Create Customer Account Site Use API · Update Customer Account Site Use API Customer Profile APIs · Create Customer Profile API · Update Customer Profile API · Create Customer Profile Amount API · Update Customer Profile Amount API Customer Account Role API · Create Customer Account Role API · Update Customer Account Role API · Create Role Responsibility API · Update Role Responsibility API Tax Assignment API · Create Location Assignment API · Update Location Assignment API Documentation on using TCA APIs .V2 Page 12 .

set_org_context('<orgid>'). x_party_id OUT NUMBER. x_msg_count OUT NUMBER.txt) b) Enter the values for the Parameters from inside the script file itself unless it is required to Enter some value from the SQL Prompt.V2 Page 13 .G_FALSE. x_profile_id OUT NUMBER ) General Tips for Running the Create Organization API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN createorg. x_msg_data OUT VARCHAR2.G_FALSE ORGANIZATION_REC_TYPE VARCHAR2 NUMBER VARCHAR2 NUMBER VARCHAR2 NUMBER PROCEDURE create_organization ( p_init_msg_list IN VARCHAR2:= FND_API. c) Set the organization id before running the script as : d) EXEC fnd_client_info. Code for Create Organization API Documentation on using TCA APIs . p_organization_rec IN ORGANIZATION_REC_TYPE. x_party_number OUT VARCHAR2. x_return_status OUT VARCHAR2. Ensure that the Profile Option HZ : Generate Party Number is Set to ‘Yes’ at Site Level.EXAMPLE ON RUNNING TCA API Example 1 : Running The Create Organization API Name of the API Base Tables Affected : : CREATE ORGANIZATION API HZ_PARTIES HZ_ORGANIZATION_PROFILES CREATE_ORGANIZATION HZ_PARTY_V2PUB Data Type PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name : : : Parameter Type p_init_msg_list p_organization_rec x_return_status x_msg_count x_msg_data x_party_id x_party_number x_profile_id Procedure IN IN OUT OUT OUT OUT OUT OUT VARCHAR2:= FND_API.

created_by_module := ’INDIA_ISC_ORGANIZATION’.1.put_line('Profile Id='|| SUBSTR (x_profile_id.'|| SUBSTR (FND_MSG_PUB. x_return_status. x_msg_count. x_profile_id NUMBER.put_line('count='||TO_CHAR(x_msg_count)). x_party_id. x_party_number.organization_nam e. p_organization_rec. hz_party_v2pub.put_line('Party_Number='|| SUBSTR (x_party_number. 255)). x_party_number VARCHAR2(2000).1. p_organization_rec. x_return_status VARCHAR2(2000).put_line('return_status='|| SUBSTR (x_return_status. Sample Output of the Create Organization Script return_status=S count=0 Msg_data = Party Id=4104 Party_Number=2448 Organization_Name=New TCA Corporation Created By=INDIA_ISC_ORGANIZATION Profile Id=2021 Documentation on using TCA APIs .put_line('Organization_Name='||SUBSTR(p_organization_rec.DECLARE p_organization_rec HZ_PARTY_V2PUB. END.255)).. dbms_output. IF x_msg_count > 1 THEN FOR I IN 1. 1. dbms_output. dbms_output. x_msg_data.ORGANIZATION_REC_TYPE.1.created_by_module. dbms_output. x_party_id NUMBER.G_FALSE ).255)).put_line('I. dbms_output.255)).255)).organization_name := ’New TCA Corporation’.255)). END LOOP.x_msg_count LOOP dbms_output. x_msg_count NUMBER. END IF. dbms_output.255)).1.put_line('CreatedBy='||SUBSTR (p_organization_rec.1.255)).V2 Page 14 .1.create_organization ( ’T’. x_profile_id). x_msg_data VARCHAR2(2000). BEGIN p_organization_rec. dbms_output.Get(p_encoded => FND_API. dbms_output.put_line('Msg_data = '|| SUBSTR (x_msg_data.put_line('Party Id='|| SUBSTR (x_party_id.1.

party_id.1. SUBSTR(party_number. SUBSTR (created_by_module. organization_name. SUBSTR(party_name.1.1. created_by_module FROM hz_organization_profiles WHERE party_id = 4104.V2 Page 15 . SUBSTR (object_version_number.25) FROM hz_parties WHERE party_id = 4104. party_id = 4104 party_number = 2448 party_name = New TCA Corpporation obj_ver = 1 created_by_mod = INDIA_ISC_ORGANIZATION SELECT organization_profile_id. object_version_number.20). org_profile_id = 2021 party_id = 4104 organization_name = New TCA Corporation obj_ver_num = 1 created_by_mod = INDIA_ISC_ORGANIZATION Documentation on using TCA APIs .1).5).Script To Verify whether the Create Organization API is successful SELECT party_id.1.

Example 2 : Running The Create Person API

Name of the API Base Tables Affected

: :

CREATE PERSON API HZ_PARTIES HZ_PERSON_PROFILES CREATE_PERSON HZ_PARTY_V2PUB HZ_CUST_ACCOUNT_V2PUB
Data Type

PL/SQL Procedure used Package Used Mandatory Parameters
Parameter Name Parameter Type

: : : IN IN OUT OUT OUT OUT OUT
OUT

p_init_msg_list p_person_rec x_party_id x_party_number x_prof i l e_i d x_return_status x_msg_count
x_msg_data
Procedure

VARCHAR2:= FND_API.G_FALSE PERSON_REC_TYPE NUMBER, VARCHAR2 NUMBER VARCHAR2 NUMBER
VARCHAR2

PROCEDURE create_person ( p_init_msg_list IN VARCHAR2:= FND_API.G_FALSE, p_person_rec IN PERSON_REC_TYPE, x_party_id OUT NUMBER, x_party_number OUT VARCHAR2, x_prof i l e_i d OUT NUMBER, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2
) General Tips for Running the Create Person API

a)

Save the API in a script file and then run the script from the SQL Prompt (Example : RUN createperson.txt) b) Enter the values for the Parameters from inside the script file itself unless it is required to Enter some value from the SQL Prompt. c) Set the organization id before running the script as : EXEC fnd_client_info.set_org_context('<orgid>'); d) Ensure that the Profile Option HZ : Generate Party Number is Set to ‘Yes’ at Site Level.
Code for Create Person API

DECLARE

Documentation on using TCA APIs - V2

Page 16

p_cust_account_rec HZ_CUST_ACCOUNT_V2PUB.CUST_ACCOUNT_REC_TYPE; p_person_rec HZ_PARTY_V2PUB.PERSON_REC_TYPE; p_customer_profile_rec HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE; x_cust_account_id NUMBER; x_account_number VARCHAR2(2000); x_party_id NUMBER; x_party_number VARCHAR2(2000); x_profile_id NUMBER; x_return_status VARCHAR2(2000); x_msg_count NUMBER; x_msg_data VARCHAR2(2000); BEGIN Fnd_client_info.set_org_context('&Org_Id'); p_cust_account_rec.account_name := '&Customer_Name'; p_cust_account_rec.created_by_module := 'TCA_EXAMPLE'; p_person_rec.person_first_name := '&First_Name'; p_person_rec.person_last_name := '&Last_Name'; hz_cust_account_v2pub.create_cust_account( 'T', p_cust_account_rec, p_person_rec, p_customer_profile_rec, 'F', x_cust_account_id, x_account_number, x_party_id, x_party_number, x_profile_id, x_return_status, x_msg_count, x_msg_data); dbms_output.put_line('x_return_status = '|| SUBSTR (x_return_status,1,255)); dbms_output.put_line('x_msg_count = '||TO_CHAR(x_msg_count)); dbms_output.put_line('Party Id = '||TO_CHAR(x_party_id)); dbms_output.put_line('Party Number = '||x_party_number); dbms_output.put_line('Profile Id = '||TO_CHAR(x_profile_id)); dbms_output.put_line('x_msg_data = '|| SUBSTR (x_msg_data,1,255)); IF x_msg_count >1 THEN FOR I IN 1..x_msg_count LOOP dbms_output.put_line(I||'. '|| SUBSTR (FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255)); END LOOP; END IF; END;

Documentation on using TCA APIs - V2

Page 17

Sample Output of the Create Person Script

x_return_status = S x_msg_count = 0 Party Id = 7860 Party Number = 6245 Profile Id = 4955 x_msg_data =
Script To Verify whether the Create Person API is successful

SELECT party_id, SUBSTR (party_number,1,5), SUBSTR (party_name,1,20), SUBSTR (person_last_name,1,20), SUBSTR(person_first_name,1,20), SUBSTR (object_version_number,1,1), SUBSTR (created_by_module,1,25) FROM hz_parties WHERE party_id = '7860'; Party_id = 7860 Party_number = 6245 Party_name = Oracle India Person_last_name = India Person_first_name = Oracle Object_version_number = 1 Created_by_module = TCA_EXAMPLE SELECT person_profile_id, party_id, effective_start_date, object_version_number, SUBSTR (created_by_module,1,20) FROM hz_person_profiles WHERE person_profile_id = ‘4955’; person_profile_id = 4955 party_id = 7860 effective_start_date = 12-MAY-02 object_version_number = 1 created_by_module = TCA_EXAMPLE

Documentation on using TCA APIs - V2

Page 18

x_party_number VARCHAR2(2000).G_FALSE.set_org_context('<orgid>'). x_party_id NUMBER.G_FALSE GROUP_REC_TYPE NUMBER VARCHAR2 VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_group ( p_init_msg_list IN VARCHAR2:= FND_API. x_return_status VARCHAR2(2000).GROUP_REC_TYPE. x_party_number OUT VARCHAR2.V2 Page 19 .Example 3 : Running The Create Group API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name Parameter Type : : : : : CREATE GROUP API HZ_PARTIES CREATE_GROUP HZ_PARTY_V2PUB Data Type p_init_msg_list p_group_rec x_party_id x_party_number x_return_status x_msg_count x_msg_data Procedure IN IN OUT OUT OUT OUT OUT VARCHAR2:= FND_API. x_party_id OUT NUMBER. x_msg_count OUT NUMBER. c) Set the organization id before running the script as : EXEC fnd_client_info. x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Group API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN create_party_group. p_group_rec IN GROUP_REC_TYPE. d) Ensure that the Profile Option HZ : Generate Party Number is Set to ‘Yes’ at Site Level. Documentation on using TCA APIs .txt) b) Enter the values for the Parameters from inside the script file itself unless it is required to Enter some value from the SQL Prompt. Code for Create Group API DECLARE p_group_rec HZ_PARTY_V2PUB. x_return_status OUT VARCHAR2.

Sample Output of the Create Group Script x_return_status = S x_msg_count = 0 Party Id = 7861 Party Number = 6246 Group Name = ISC Group x_msg_data = Script To Verify whether the Create Group API is successful SELECT party_id.Get(p_encoded => FND_API.1. SUBSTR (created_by_module.group_name := ‘&Group_Name’.V2 Page 20 . x_msg_count. dbms_output. P_group_rec.50)). x_msg_data).255)).put_line(‘x_msg_data = ‘||SUBSTR (x_msg_data.create_group( ‘T’. hz_party_v2pub. BEGIN Fnd_client_info.1. END IF.group_name.1.1.25) FROM hz_parties WHERE party_id = 7861.created_by_module := 'TCA_EXAMPLE'. SUBSTR (object_version_number. SUBSTR(party_name. 1.255)).put_line(‘x_msg_count = ‘||TO_CHAR(x_msg_count)). END LOOP. IF x_msg_count >1 THEN FOR I IN 1. x_party_number. dbms_output.1.G_FALSE ).put_line(I||’. x_party_id. x_msg_data VARCHAR2(2000).5).x_msg_count NUMBER. x_return_status.set_org_context(‘&Org_Id’). P_group_rec.put_line(‘Party Id = ‘||TO_CHAR(x_party_id)).20). dbms_output. p_group_rec.group_type := ‘&Group_Type’.put_line(‘x_return_status = ‘||SUBSTR(x_return_status. dbms_output. dbms_output. p_group_rec.x_msg_count LOOP dbms_output.1. ‘||SUBSTR (FND_MSG_PUB.1..put_line(‘Group Name = ‘||SUBSTR (p_group_rec.put_line(‘Party Number = ‘||x_party_number). END. SUBSTR (party_number. dbms_output. 255)). Party_id = 7861 Party_number = 6246 Party_name = ISC Group Obj_ver = 1 Documentation on using TCA APIs .1).

V2 Page 21 .Created_by_module = TCA_EXAMPLE Documentation on using TCA APIs .

To get the Decision Make Flag Parameter run the query : SELECT DISTINCT decision_maker_flag FROM hz_org_contacts.G_FALSE ORG_CONTACT_REC_TYPE NUMBER NUMBER NUMBER VARCHAR2 VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_org_contact ( p_init_msg_list IN VARCHAR2:= FND_API.G_FALSE. x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Organization Contact API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN contactphone. p_org_contact_rec IN ORG_CONTACT_REC_TYPE. x_msg_count OUT NUMBER. x_return_status OUT VARCHAR2. x_org_contact_id OUT NUMBER. x_party_id OUT NUMBER. To get the value for Job Title Parameter run the query : SELECT DISTINCT job_title FROM hz_org_contacts.txt) b) To get the value for Department Parameter run the query: SELECT DISTINCT department FROM hz_org_contacts.Example 4 : Create Org Contact API Name of the API Base Tables Affected : : CREATE ORG CONTACT HZ_ORG_CONTACTS HZ_RELATIONSHIPS CREATE_ORG_CONTACT HZ_PARTY_CONTACT_V2PUB PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name Parameter Type : : : Data Type p_init_msg_list p_org_contact_rec x_org_contact_id x_party_rel_id x_party_id x_party_number x_return_status x_msg_count x_msg_data Procedure IN IN OUT OUT OUT OUT OUT OUT OUT VARCHAR2:= FND_API. To get the Job Title Code Parameter run the query: Documentation on using TCA APIs .V2 Page 22 . x_party_number OUT VARCHAR2. x_party_rel_id OUT NUMBER.

x_msg_count NUMBER.object_table_name := 'HZ_PARTIES'.party_rel_rec.start_date := SYSDATE.V2 Page 23 .job_title := INITCAP(‘&Job_Title’).decision_maker_flag := UPPER(‘&Decision_Maker_Flag’). To get the Object Id Parameter run the query: SELECT DISTINCT object_id FROM hz_relationships.ORG_CONTACT_REC_TYPE. x_org_contact_id. x_org_contact_id NUMBER.relationship_type := UPPER(‘&Relation Type’). x_party_id NUMBER. p_org_contact_rec. Example For Running a Create Org Contact API DECLARE p_org_contact_rec HZ_PARTY_CONTACT_V2PUB.party_rel_rec.party_rel_rec. To get the Subject Type Parameter run the query: SELECT DISTINCT subject_type FROM hz_relationships.department_code := INITCAP(‘&Department_Code’). Documentation on using TCA APIs . BEGIN p_org_contact_rec.relationship_code := UPPER(‘&Relation_Code’). x_party_rel_id.create_org_contact( 'T'. p_org_contact_rec. To get the Object Type Parameter run the query: SELECT DISTINCT object_type FROM hz_relationships. p_org_contact_rec.party_rel_rec. To get the Relationship Code Parameter run the query: SELECT DISTINCT relationship_code FROM hz_relationships. To get the Subject Id Parameter run the query: SELECT subject_id FROM hz_relationships.object_id := &Object_Id.party_rel_rec. p_org_contact_rec. x_return_status VARCHAR2(2000).object_type := UPPER(‘&Object_Type’).party_rel_rec. x_party_number VARCHAR2(2000). c) Set the organization id before running the script as : EXEC fnd_client_info. x_party_rel_id NUMBER. p_org_contact_rec. p_org_contact_rec. To get the Relationship Type Parameter run the query : SELECT DISTINCT relationship_type FROM hz_relationships.party_rel_rec. p_org_contact_rec. p_org_contact_rec. p_org_contact_rec. p_org_contact_rec.set_org_context('<orgid>').SELECT DISTINCT job_title_code FROM hz_org_contacts.party_rel_rec.subject_id := &Subject_Id.subject_table_name := 'HZ_PARTIES'.job_title_code := UPPER(‘&Job_Title_Code’). hz_party_contact_v2pub.party_rel_rec. p_org_contact_rec. x_msg_data VARCHAR2(2000). p_org_contact_rec. p_org_contact_rec.subject_type := UPPER(‘&Subject_Type’). p_org_contact_rec.created_by_module := 'TCA_EXAMPLE'.

x_msg_count.put_line('x_msg_count = '||TO_CHAR(x_msg_count)).put_line(‘Object Id=’||p_org_contact_rec. dbms_output.subject_id := 1006. old 17: p_org_contact_rec.put_line(‘Object Type=’||UPPER(p_org_contact_rec.V2 Page 24 . new 19: p_org_contact_rec.G_FALSE). old 13: p_org_contact_rec.subject_id).job_title := INITCAP ('&Job_Title'). x_msg_data).put_line('x_msg_data = '||SUBSTR(x_msg_data.x_msg_count LOOP dbms_output.object_type := UPPER('&Object_Type').party_rel_rec.put_line(I||'.. old 12: p_org_contact_rec. IF x_msg_count >1 THEN FOR I IN 1.job_title := INITCAP ('Accounting Manager').job_title_code := UPPER('aps').Get(p_encoded =>FND_API. old 16: p_org_contact_rec.subject_Type)). dbms_output.party_rel_rec.party_rel_rec. new 12: p_org_contact_rec. old 19: p_org_contact_rec.put_line('x_return_status = '||SUBSTR(x_return_status.'||SUBSTR(FND_MSG_PUB. new 17: p_org_contact_rec.decision_maker_flag := UPPER('n').decision_maker_flag := UPPER('&Decision_Maker_Flag'). END.put_line(‘Subject Type=’||UPPER(p_org_contact_rec. old 14: p_org_contact_rec.party_rel_rec.subject_id := &Subject_Id. new 20: p_org_contact_rec. END IF.object_id). dbms_output. 1. dbms_output. 255)).party_rel_rec.subject_type := UPPER('&Subject_Type').party_rel_rec. old 20: p_org_contact_rec.255)).object_id := 3610. Sample Output of the Create Org Contact Script old 11: p_org_contact_rec.255)). dbms_output.department_code := INITCAP('&Department_Code'). new 13: p_org_contact_rec.x_party_id. END LOOP.subject_type := UPPER('organization').department_code := INITCAP ('Finance').object_id := &Object_Id. Documentation on using TCA APIs . dbms_output.1.party_rel_rec. new 14: p_org_contact_rec.party_rel_rec.party_rel_rec.object_type)). dbms_output. new 11: p_org_contact_rec. x_party_number.party_rel_rec. x_return_status.1. new 16: p_org_contact_rec.party_rel_rec.object_type := UPPER('person').job_title_code := UPPER('&Job_Title_Code').put_line(‘Subject Id=’||p_org_contact_rec.party_rel_rec.

party_type FROM hz_parties WHERE Party_id = 3611.V2 Page 25 . party_id FROM hz_relationships WHERE relationship_id = 3284 . subject_type. party_number. directional_flag . Party_id = 3611 Party_number = 3611 Party_name = Paul Cheng-Computer Service Party_type = PARTY_RELATIONSHIP Documentation on using TCA APIs . object_type. party_relationship_id. relationship_code. subject_table_name. relationship_type.party_rel_rec. party_name. department_code FROM hz_org_contacts WHERE party_relationship_id = 3284 .relationship_code := UPPER('&Relation_Code’).relationship_code := UPPER('contact'). relationship_id = 3284 subject_id = 3610 subject_type = person subject_table_name = HZ_PARTIES object_id = 1006 object_type = ORGANIZATION directional_flag = F relationship_type = EMPLOYMENT relationship_code = EMPLOYEE_OF party_id = 3611 SELECT party_id.old 22: p_org_contact_rec. new 22: p_org_contact_rec. org_contact_id = 3248 party_relationship_id = 3284 department_code = FINANCE SELECT relationship_id. x_return_status = S x_msg_count = 0 Subject Id=1006 Subject Type=ORGANIZATION Object Id=3610 Object Type=PERSON x_msg_data = Script To Verify whether the Org Contact Point API is successful SELECT org_contact_id. subject_id.party_rel_rec. object_id.

Example 5 : Create Location API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name Parameter Type : : : : : CREATE LOCATION API HZ_LOCATIONS CREATE_LOCATION HZ_LOCATION_V2PUB Data Type p_init_msg_list p_location_rec x_location_id x_return_status x_msg_count x_msg_data Procedure IN IN OUT OUT OUT OUT VARCHAR2:= FND_API. x_return_status OUT VARCHAR2. x_msg_count OUT NUMBER. p_location_rec IN LOCATION_REC_TYPE.set_org_context('<orgid>'). Documentation on using TCA APIs .V2 Page 26 .G_FALSE.txt) b) Enter the values for the Parameters from inside the script file itself unless it is required to Enter some value from the SQL Prompt c) Set the organization id before running the script as : EXEC fnd_client_info. x_location_id OUT NUMBER. x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Location API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN createloc.G_FALSE LOCATION_REC_TYPE NUMBER VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_location ( p_init_msg_list IN VARCHAR2:= FND_API. d) Ensure that the Profile Option Default Country is Set to ‘<Country Name>’ at Site Level.

1.created_by_module.x_msg_count LOOP dbms_output.LOCATION_REC_TYPE. dbms_output.put_line('x_return_status = '||SUBSTR(x_return_status.state := 'Andhra Pradesh'.postal_code := '500083'. p_location_rec. p_location_rec.state. p_location_rec.create_location( 'T'. END LOOP. dbms_output. x_location_id. X_msg_data varchar2(2000). X_msg_count number.Get(p_encoded=> FND_API. Sample Output of the Create Location Script x_return_status = S x_msg_count = 0 Location Id = 3220 Country = US Address1 = 4th Floor Cyber Towers State = Andhra Pradesh Created By = TCA_EXAMPLE Documentation on using TCA APIs .G_FALSE ). p_location_rec.country. END IF.255)).1. x_return_status.country := 'US'.255)).put_line('x_msg_data = '|| SUBSTR(x_msg_data.address2 := 'Hitec City'.put_line('Location Id = '||TO_CHAR(x_location_id)).V2 Page 27 .put_line('State = '|| SUBSTR(p_location_rec.Address1. IF x_msg_count > 1 THEN FOR I IN 1. 255)).1.put_line('Country = '|| SUBSTR(p_location_rec.1.1.255)). p_location_rec. BEGIN p_location_rec.255)). x_msg_data). dbms_output. X_location_id number.1.put_line('Created By = '|| SUBSTR(p_location_rec. dbms_output.'||SUBSTR(FND_MSG_PUB.. dbms_output. p_location_rec. dbms_output.city := 'Madhapur'. hz_location_v2pub. dbms_output. END.put_line('Address1 = '|| SUBSTR(p_location_rec.255)).255)).put_line(I||'.1. dbms_output. p_location_rec.put_line('x_msg_count = '||TO_CHAR(x_msg_count)). X_return_status varchar2(2000). x_msg_count.Example For Running a Create Location API DECLARE P_location_rec HZ_LOCATION_V2PUB.address1 := '4th Floor Cyber Towers'.created_by_module := 'TCA_EXAMPLE'.

1. SUBSTR(address1. Location_id = 3220 Address1 = 4th Floor Cyber Towers Address2 = Hitec City City = Madhapur State = Andhara Pra Postal_code = 500083 Country = US Object_version_number = 1 Created_by_module = TCA_EXAMPLE Documentation on using TCA APIs .1.x_msg_data = Script To Verify whether the Create Location API is successful SELECT SUBSTR(location_id. SUBSTR(address2.5).1.10). SUBSTR(Postal_code.10).25).10) FROM hz_locations WHERE location_id = 3220.1). SUBSTR(object_version_number.1.1.1.10).V2 Page 28 .1.10).7).1.1. SUBSTR(created_by_module. SUBSTR(country. SUBSTR(state. SUBSTR(city.

txt) b) Enter the new value for the Parameters Address1 which has to be changed.V2 Page 29 .set_org_context('<orgid>'). x_return_status OUT VARCHAR2.Example 6 : Update Location API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name : : : : UPDATE LOCATION API HZ_LOCATIONS UPDATE_LOCATION HZ_LOCATION_V2PUB : Parameter Type Data Type p_init_msg_list p_location_rec p_object_version_number x_return_status x_msg_count x_msg_data Procedure IN IN IN OUT OUT OUT OUT VARCHAR2:= FND_API. p_location_rec IN LOCATION_REC_TYPE. p _ object_version_number IN OUT NUMBER. x_msg_count OUT NUMBER. x_msg_data OUT VARCHAR2 ) General Tips for Running the Update Location API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN updateloc. c) Set the organization id before running the script as : EXEC fnd_client_info. Documentation on using TCA APIs .G_FALSE LOCATION_REC_TYPE NUMBER VARCHAR2 NUMBER VARCHAR2 PROCEDURE update_location ( p_init_msg_list IN VARCHAR2:=FND_API. from the SQL Prompt.G_FALSE.

object_version_number Documentation on using TCA APIs . x_msg_data VARCHAR2(2000). dbms_output.G_FALSE ). x_msg_count. END IF.G_MISS_CHAR.put_line('x_msg_count = '||TO_CHAR(x_msg_count)). 255)). hz_location_v2pub.address1 := '&New_Address1'. END LOOP.255)).V2 Page 30 . BEGIN p_location_rec.1. Enter value for new_address1: 4th Floor Cyber Gateway old 10: p_location_rec.Example For Running a Update Location API DECLARE p_location_rec HZ_LOCATION_V2PUB. x_msg_count NUMBER.location_id := 3211.255))..x_msg_count LOOP dbms_output.1.address1 := '4th Floor Cyber Gateway'. x_return_status VARCHAR2(2000).1.put_line('Changed Address1 = '||SUBSTR(p_location_rec. dbms_output.put_line(I||'. x_msg_data). p_location_rec. END. p_location_rec. p_object_version_number NUMBER. Sample Output of the Update Location Script old 8: p_location_rec. x_return_status = S x_msg_count = 0 Changed Address1 = 4th Floor Cyber Gateway x_msg_data = Script To Verify whether Update Location API is successful SELECT address1. IF x_msg_count >1 THEN FOR I IN 1.255)). 1. p_object_version_number := 1.location_id := &Location_Id.LOCATION_REC_TYPE.address1 := '&New_Address1'. x_return_status. new 10: p_location_rec.put_line('x_return_status = '||SUBSTR(x_return_status. dbms_output.Get(p_encoded=> FND_API.address1.location_id := &Location_Id. dbms_output. address2.address2 := FND_API. new 8: p_location_rec. p_object_version_number.update_location( 'T'.'||SUBSTR(FND_MSG_PUB.put_line('x_msg_data = '||SUBSTR(x_msg_data. p_location_rec. county.

FROM hz_locations WHERE location_id = 3211. address1 = 4TH FLOOR CYBER GATEWAY address2 = ‘ ‘ county = TEST object_version_number = 2 Documentation on using TCA APIs .V2 Page 31 .

d) Set the organization id inside the script as : EXEC fnd_client_info. Documentation on using TCA APIs . x_party_site_id OUT NUMBER.G_FALSE PARTY_SITE_REC_TYPE NUMBER VARCHAR2 VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_party_site ( p_init_msg_list IN VARCHAR2:= FND_API. x_msg_count OUT NUMBER. SELECT party_id FROM hz_parties. x_party_site_number OUT VARCHAR2. c) Enter the values for Party Id and Location Id as valid values from HZ_PARTIES and HZ_LOCATIONS respectively.set_org_context('<orgid>').V2 Page 32 . x_return_status OUT VARCHAR2.Example 7 : Create Party Site API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name Parameter Type : : : : : CREATE PARTY SITE HZ_PARTY_SITES CREATE_PARTY_SITE HZ_PARTY_SITE_V2PUB Data Type p_init_msg_list p_party_site_rec x_party_site_id x_party_site_number x_return_status x_msg_count x_msg_data Procedure IN IN OUT OUT OUT OUT OUT VARCHAR2:= FND_API. p_party_site_rec IN PARTY_SITE_REC_TYPE.G_FALSE. x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Party Site API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN createpsite. SELECT location_id FROM hz_locations.txt) b) Enter the values for the Parameters Party Id and Location Id from the SQL prompt itself as hard coding these two parameters means the script has to be changed for the value of these two parameters each time a new Party Site is created.

END IF.G_FALSE). dbms_output.1. 1.255)).put_line('Party Site Number = '||SUBSTR(x_party_site_number.put_line('x_msg_count = '||TO_CHAR(x_msg_count)). p_party_site_rec.PARTY_SITE_REC_TYPE.255)). hz_party_site_v2pub.party_id := &Party_Id. x_msg_data VARCHAR2(2000).x_msg_count LOOP dbms_output.identifying_address_flag := 'Y'. new 10: p_party_site_rec.V2 Page 33 .create_party_site( 'T'.party_id := &Party_Id. x_msg_data).. END LOOP.Get(p_encoded=> FND_API.location_id := &Location_Id. dbms_output. x_party_site_id NUMBER. dbms_output.Example For Running a Create Party Site API DECLARE p_party_site_rec HZ_PARTY_SITE_V2PUB.put_line('x_return_status = '||SUBSTR(x_return_status. x_party_site_id.party_id := 4102.put_line(I||'. old 10: p_party_site_rec.1. BEGIN p_party_site_rec.created_by_module := 'TCA_EXAMPLE'. x_return_status = S x_msg_count = 0 Party Site Id = 3615 Party Site Number = 2248 Documentation on using TCA APIs . dbms_output. x_return_status VARCHAR2(2000).location_id := &Location_Id.put_line('x_msg_data = '||SUBSTR(x_msg_data. IF x_msg_count >1 THEN FOR I IN 1. x_return_status.put_line('Party Site Id = '||TO_CHAR(x_party_site_id)). x_msg_count NUMBER. p_party_site_rec. dbms_output. new 9: p_party_site_rec. x_party_site_number VARCHAR2(2000). Sample Output of the Create Party Site Script old 9: p_party_site_rec. p_party_site_rec.1. END. 255)). p_party_site_rec.location_id := 3220.'||SUBSTR(FND_MSG_PUB. x_msg_count. x_party_site_number.255)).

SUBSTR(STATE.1.1. address1 = 4th Floor Cyber Towe address2 = Hitec City city = Madhapur state = Andhra Pra postal_code = 500083 country = US Documentation on using TCA APIs . SUBSTR (location_id. SUBSTR(COUNTRY.1.1.20). SUBSTR (party_site_number.V2 Page 34 .7) FROM hz_party_sites WHERE party_site_id = 3615.1.x_msg_data = Script To Verify whether the Create Party Site API is successful SELECT SUBSTR(party_site_id. SUBSTR(ADDRESS2.1.5).1.10).15). party_site_id = 3615 party_id = 4102 location_id = 3220 party_site_number = 2248 SELECT SUBSTR(ADDRESS1. SUBSTR(POSTAL_CODE.1. SUBSTR (party_id.6).6). SUBSTR(CITY.1.6).10) FROM HZ_PARTIES WHERE PARTY_ID = 4102.10).1.

x_party_site_use_id OUT NUMBER. Example For Running a Create Party Site Use API DECLARE p_party_site_use_rec HZ_PARTY_SITE_V2PUB.G_FALSE PARTY_SITE_USE_REC_TYPE NUMBER VARCHAR2 NUMBER PROCEDURE create_party_site_use ( p_init_msg_list IN VARCHAR2:= FND_API. The Parameter Party Site Use can be entered in either lower case or upper case as the system will take care of changing the case to upper.Example 8 : Create Party Site Use API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name Parameter Type : : : : CREATE PARTY SITE USE HZ_PARTY_SITE_USES CREATE_PARTY_SITE_USE HZ_PARTY_SITE_V2PUB : Data Type p_init_msg_list p_party_site_use_rec x_party_site_use_id x_return_status x_msg_count Procedure IN IN OUT OUT OUT VARCHAR2:= FND_API. x_msg_count OUT NUMBER. x_return_status OUT VARCHAR2.V2 Page 35 . Documentation on using TCA APIs . x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Party Site Use API a) b) c) d) e) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN createpsiteuse. p_party_site_use_rec IN PARTY_SITE_USE_REC_TYPE.G_FALSE.PARTY_SITE_USE_REC_TYPE.txt) Enter the values for the Parameters Party Site Use and Party Site Id from SQL Prompt itself as hard coding these two parameters means the script has to be changed for the value of these two parameters each time a new Party Site Use is created. Set the organization id before running the script as : EXEC fnd_client_info. That is The Site use can be entered as bill_to or BILL_TO or Bill_To. SELECT party_site_id FROM hz_party_sites. Enter the value for Party Site Id as a valid value from HZ_PARTY_SITES table.set_org_context('<orgid>').

BEGIN p_party_site_use_rec. x_msg_data).put_line('x_msg_count = '||TO_CHAR(x_msg_count)).1.'||SUBSTR(FND_MSG_PUB.x_msg_count LOOP dbms_output. dbms_output.x_party_site_use_id NUMBER. x_return_status = S x_msg_count = 0 Site Use Id = 2022 x_msg_data = Script To Verify whether the Create Party Site Use API is successful SELECT party_site_use_id.put_line('Site Use Id = '||TO_CHAR(x_party_site_use_id)).party_site_id := &Party_Site_Id. x_return_status. dbms_output. p_party_site_use_rec. Sample Output of the Create Party Site Use Script old 8: p_party_site_use_rec.V2 Page 36 . 1. x_party_site_use_id..site_use_type := upper('bill_to').255)). dbms_output. p_party_site_use_rec.site_use_type := upper('&Party_Site_Use'). END IF.put_line('x_return_status = '||substr(x_return_status.party_site_id := 3614. IF x_msg_count >1 THEN FOR I IN 1. END. primary_per_type FROM hz_party_site_uses WHERE party_site_use_id = 2022. party_site_use_id = 2022 party_site_id = 3614 use_type = BILL_TO primary_per_type = Y Documentation on using TCA APIs .create_party_site_use( 'T'. new 9: p_party_site_use_rec. site_use_type.Get(p_encoded=> FND_API. new 8: p_party_site_use_rec. x_msg_data VARCHAR2(2000).G_FALSE ).put_line(I||'. dbms_output. x_return_status VARCHAR2(2000). x_msg_count NUMBER.created_by_module := 'TCA_EXAMPLE'. hz_party_site_v2pub.1.255)). x_msg_count.put_line(SubStr('x_msg_data = '||x_msg_data. p_party_site_use_rec.site_use_type := upper('&Party_Site_Use').party_site_id := &Party_Site_Id. party_site_id. old 9: p_party_site_use_rec. END LOOP. 255)).

p_telex_rec IN TELEX_REC_TYPE:= G_MISS_TELEX_REC. Phone Area Code. p_edi_rec IN EDI_REC_TYPE:= G_MISS_EDI_REC. p_email_rec IN EMAIL_REC_TYPE:= G_MISS_EMAIL_REC.V2 Page 37 . x_contact_point_id OUT NUMBER. Contact Point Purpose. p_phone_rec IN PHONE_REC_TYPE:= G_MISS_PHONE_REC. p_web_rec IN WEB_REC_TYPE:= G_MISS_WEB_REC. x_return_status OUT VARCHAR2. x_msg_count OUT NUMBER. Phone Number and Phone Line Type from SQL Prompt itself as hard coding these parameters means the script has to be changed for Documentation on using TCA APIs .G_FALSE. Phone Country Code. x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Contact Point API (Phone) a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN contactphone.txt) b) Enter the values for the Parameters Primary Flag. p_contact_point_rec IN CONTACT_POINT_REC_TYPE.G_FALSE CONTACT_POINT_REC_TYPE EDI_REC_TYPE:= G_MISS_EDI_REC EMAIL_REC_TYPE:= G_MISS_EMAIL_REC PHONE_REC_TYPE:= G_MISS_PHONE_REC TELEX_REC_TYPE:= G_MISS_TELEX_REC WEB_REC_TYPE:= G_MISS_WEB_REC NUMBER VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_contact_point ( p_init_msg_list IN VARCHAR2:= FND_API.Example 9 : Create Party Site API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name Parameter Type : : : : CREATE CONTACT POINT HZ_CONTACT_POINTS CREATE_CONTACT_POINT HZ_CONTACT_POINT_V2PUB : Data Type p_init_msg_list p_contact_point_rec p_edi_rec p_email_rec p_phone_rec p_telex_rec p_web_rec x_contact_point_id x_return_status x_msg_count x_msg_data Procedure IN IN IN IN IN IN IN OUT OUT OUT OUT VARCHAR2:= FND_API.

p_phone_rec.create_contact_point( 'T'.primary_flag := UPPER('&Primary_Flag'). p_phone_rec HZ_CONTACT_POINT_V2PUB. p_web_rec HZ_CONTACT_POINT_V2PUB.owner_table_id := '3804'. p_edi_rec. p_phone_rec. p_contact_point_rec. Contact Point Purpose and Phone Line Type can be entered in either lower case or upper case as the system will take care of changing the case to upper.TELEX_REC_TYPE.contact_point_type := 'PHONE'. x_msg_count NUMBER.phone_area_code := '&Phone_Area_Code'. p_email_rec. p_telex_rec HZ_CONTACT_POINT_V2PUB.phone_country_code := UPPER('&Phone_Country_Code'). The Parameter Primary Flag.EDI_REC_TYPE.owner_table_name := 'HZ_PARTIES'.phone_number := '&Phone_Number'. owner_table_name FROM hz_contact_points WHERE owner_table_name LIKE ‘%HZ_PARTIES%’. p_edi_rec HZ_CONTACT_POINT_V2PUB. phone_country_code FROM hz_phone_country_codes WHERE UPPER(territory_code) LIKE ‘%US%’. BEGIN p_contact_point_rec.set_org_context('<orgid>').c) d) e) f) g) the value of these parameters each time a new Contact Point ( Phone ) is created. p_phone_rec. Enter the value for phone_country_code as a valid value from from hz_phone_country_codes using the query : SELECT territory_code. The values for owner_table_id and owner_table_name parameters can be seen from HZ_PARTIES table using the query : SELECT owner_table_id. p_contact_point_rec. p_contact_point_rec. Set the organization id before running the script as : EXEC fnd_client_info. x_return_status VARCHAR2(2000).EMAIL_REC_TYPE. p_contact_point_rec. hz_contact_point_v2pub.CONTACT_POINT_REC_TYPE. Example For Running a Create Contact Point API (Phone) DECLARE p_contact_point_rec HZ_CONTACT_POINT_V2PUB. x_msg_data VARCHAR2(2000).phone_line_type := UPPER('&Phone_Line_Type'). p_contact_point_rec. p_phone_rec. Enter the value of area code using the query : SELECT UPPER(area_code) FROM hz_timezone_mapping.contact_point_purpose := UPPER('&Contact_Purpose').PHONE_REC_TYPE.created_by_module := 'TCA_EXAMPLE'. p_contact_point_rec.V2 Page 38 . p_email_rec HZ_CONTACT_POINT_V2PUB.WEB_REC_TYPE. x_contact_point_id NUMBER. Documentation on using TCA APIs .

p_phone_rec.primary_flag := UPPER('&Primary_Flag'). '||SUBSTR(FND_MSG_PUB. owner_table_name. p_telex_rec. new 21: p_phone_rec.phone_area_code := '&Phone_Area_Code'.G_FALSE ). 1.. contact_point_type.1. dbms_output.phone_line_type := UPPER('gen'). new 18: p_phone_rec. x_msg_data).put_line(SUBSTR('x_return_status = '||x_return_status.255)). Documentation on using TCA APIs .phone_country_code := UPPER('&Phone_Country_Code'). x_return_status.255)). x_return_status = S x_msg_count = 0 Contact Point Id = 6330 Phone Number = 7000-200 x_msg_data = Script To Verify whether the Contact Point API (Phone) is successful SELECT contact_point_id. dbms_output.primary_flag := UPPER('y'). x_contact_point_id.phone_number := '7000-200'. IF x_msg_count >1 THEN FOR I IN 1.x_msg_count LOOP dbms_output. old 18: p_phone_rec.put_line('x_msg_count = '||TO_CHAR(x_msg_count)).put_line(I||'.phone_line_type := UPPER('&Phone_Line_Type').put_line(SUBSTR('x_msg_data = '||x_msg_data.phone_country_code := UPPER('1').1.phone_number := '&Phone_Number'. owner_table_id.Get(p_encoded => FND_API. old 20: p_phone_rec. old 19: p_phone_rec. END. new 20: p_phone_rec. old 21: p_phone_rec. Sample Output of the Create Contact Point (Phone) Script old 16: p_contact_point_rec. old 17: p_contact_point_rec. END IF. new 17: p_contact_point_rec. dbms_output. END LOOP. new 16: p_contact_point_rec.phone_area_code := '650'.contact_point_purpose := UPPER('&Contact_Purpose'). x_msg_count.V2 Page 39 . p_web_rec. new 19: p_phone_rec. 255)).contact_point_purpose := UPPER('business').

phone_area_code.primary_flag. phone_line_type. phone_number.V2 Page 40 . contact_point_id = 6330 contact_point_phone = PHONE owner_table_name = HZ_PARTIES owner_table_id = 3804 primary_flag = Y phone_area_code = 650 phone_country_code = 1 phone_number = 7000-200 phone_line_type = GEN raw_phone_num = 650-7000-200 Documentation on using TCA APIs . raw_phone_number FROM hz_contact_points WHERE contact_point_id = 6330 . phone_country_code.

The Value for Parameter Forward_Relationship_Code should be one of the Values for the Look Up Code PARTY_RELATIONS_TYPE .G_FALSE RELATIONSHIP_TYPE_REC_TYPE NUMBER VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_relationship_type ( p_init_msg_list IN VARCHAR2:= FND_API. Documentation on using TCA APIs . x_msg_count OUT NUMBER. Direction_Code. c) Enter the Values of the Parameters : Relationship_Type. x_relationship_type_id OUT NUMBER. Object_Type. ii. (Example : RUN createrelationtype. Created_By_Moudle either from inside the API or at the SQL Prompt.txt) b) The Value for Organization Id is accepted as a Parameter.Example 10 : Create Relationship Type API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name : : : : CREATE RELATIONSHIP TYPE HZ_RELATIONSHIP_TYPES CREATE_RELATIONSHIP_TYPE HZ_RELATIONSHIP_TYPE_V2PUB : Parameter Type Data Type p_init_msg_list p_relationship_type_rec x_relationship_type_id x_return_status x_msg_count x_msg_data Procedure IN IN OUT OUT OUT OUT VARCHAR2:= FND_API. p_relationship_type_rec IN RELATIONSHIP_TYPE_REC_TYPE. Forward_Relationship_Code. x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Relationship Type API a) Save the API in a script file and then run the script from the SQL Prompt 1.G_FALSE. Subject_Type. x_return_status OUT VARCHAR2.V2 Page 41 . i. The value for Parameter Relationship_Type should be one of the Values defined for the Look Up Code PARTY_RELATIONS_TYPE . Backward_Relationship_Code.

p_relationship_type_rec_type.create_relationship_type( 'T'. If the direction code is ‘P’ or ‘C’. The Value for Parameter Subject_Type should be one of the Values from the Column INSTANCE_SET_NAME from the table FND_OBJECT_INSTANCE_SETS . x_relationship_type_id NUMBER.V2 Page 42 . If the forward relationship code is the same as the backward relationship code.backward_rel_code := upper('&Backward_Relationship_Code'). p_relationship_type_rec_type. the direction code should be ‘N’ . p_relationship_type_rec_type. Documentation on using TCA APIs . x_relationship_type_id. viii. p_relationship_type_rec_type.direction_code := upper('&Rel_Direction'). If the values of the parameters Forward_Relationship_Code and Backward_Relationship_Code are same then the Direction_Code should be ‘N’ only. C – Child. General Tips for Running the Create Relationship Type API DECLARE p_relationship_type_rec_type HZ_RELATIONSHIP_TYPE_V2PUB. Thus.RELATIONSHIP_TYPE_REC_TYPE. The direction code will be used to determine if a backward relationship type should be created. The combination of forward relationship code.set_org_context('&Org_Id'). vii. p_relationship_type_rec_type.relationship_type := upper('&Relationship_Type'). backward relationship code. x_msg_count NUMBER. p_relationship_type_rec_type. subject type. N – Non-Directional. p_relationship_type_rec_type.object_type := upper('&Object_Type').iii. x_return_status VARCHAR2(2000).created_by_module := 'TCA_Example'. x_msg_data VARCHAR2(2000). BEGIN fnd_client_info. ix. The Value of Direction_Code should be either : P .Parent. and object_type should be unique. The combination of relationship type. iv. subject type. v.forward_rel_code := upper('&Forward_Relationship_Code'). hz_relationship_type_v2pub. The Value for Parameter Object_Type should be one of the Values from the Column INSTANCE_SET_NAME from the table FND_OBJECT_INSTANCE_SETS .subject_type := upper('&Subject_Type'). forward relationship code. p_relationship_type_rec_type.Non directional. a second record with same combination of these three should have same backward relationship code. x_return_status. vi. we will create a second relationship type. x. The Value for Parameter Backward_Relationship_Code should be one of the Values for the Look Up Code PARTY_RELATIONS_TYPE . and object type should be able to identify an unique backward relationship code.

dbms_output.subject_type := UPPER ('&Subject_Type'). END IF.subject_type := UPPER ('organization'). 1.relationship_type := UPPER ('contact'). END LOOP.put_line('x_msg_count = '||TO_CHAR(x_msg_count)). new 12: p_relationship_type_rec_type. dbms_output. Enter value for object_type: organization old 15: p_relationship_type_rec_type.set_org_context('&Org_Id').relationship_type := UPPER('&Relationship_Type'). END. '||SUBSTR(FND_MSG_PUB. Enter value for subject_type: organization old 14: p_relationship_type_rec_type. new 13: p_relationship_type_rec_type. Enter value for forward_relationship_code: contact_of old 11: p_relationship_type_rec_type.backward_rel_code := UPPER ('contact_of').set_org_context('204').put_line('x_return_status = '||SUBSTR(x_return_status. Enter value for relationship_type: contact old 10: p_relationship_type_rec_type.put_line('Relationship Id ='||TO_CHAR(x_relationship_type_id)). new 14: p_relationship_type_rec_type.x_msg_count.forward_rel_code := UPPER ('contact_of').255)). new 15: p_relationship_type_rec_type. new 9: fnd_client_info.x_msg_count LOOP dbms_output.object_type := UPPER ('&Object_Type'). new 10: p_relationship_type_rec_type.direction_code := UPPER ('n').V2 Page 43 .Get(p_encoded => FND_API. Sample Output of the Create Relationship Type Script Enter value for org_id: 204 old 9: fnd_client_info.put_line(I||'.direction_code := UPPER ('&Rel_Direction').object_type := UPPER ('organization'). dbms_output.1.forward_rel_code := UPPER ('&Forward_Relationship_Code'). x_return_status = S x_msg_count = 0 Relationship Id =1024 Documentation on using TCA APIs .1. IF x_msg_count >1 THEN FOR I IN 1. dbms_output. new 11: p_relationship_type_rec_type..put_line('x_msg_data = '||SUBSTR(x_msg_data.G_FALSE ). 255)).backward_rel_code := UPPER ('&Backward_Relationship_Code'). x_msg_data). Enter value for backward_relationship_code: contact_of old 12: p_relationship_type_rec_type. Enter value for rel_direction: n old 13: p_relationship_type_rec_type.255)).

x_msg_data = Script To Verify whether Create Relationship Type API is successful SELECT relationship_type_id. created_by_module FROM hz_relationship_types WHERE relationship_type_id = '1024'. forward_rel_code. subject_type. relationship_type.V2 Page 44 . object_type. backward_rel_code. status. relationship_type_id = 1024 relationship_type = CONTACT forward_rel_code = CONTACT_OF backward_rel_code = CONTACT_OF direction_code = N subject_type = ORGANIZATION object_type = ORGANIZATION status = A created_by_module = TCA_EXAMPLE Documentation on using TCA APIs . direction_code.

x_return_status OUT VARCHAR2. Subject_Type. x_party_id OUT NUMBER. Subject_Table_Name. Object_Type. c) Enter the Values of the Parameters : Relationship_Type. Object_Id. Subject_Id. x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Relationship API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN createrelation. x_relationship_id OUT NUMBER. x_msg_count OUT NUMBER.V2 Page 45 .G_FALSE RELATIONSHIP_REC_TYPE NUMBER NUMBER VARCHAR2 VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_relationship ( p_init_msg_list IN VARCHAR2:= FND_API. Documentation on using TCA APIs . Relationship_Code.G_FALSE. p_relationship_rec IN RELATIONSHIP_REC_TYPE. Object_Table_Name.Example 11 : Create Relationship API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name Parameter Type : : : : CREATE RELATIONSHIP HZ_RELATIONSHIPS CREATE_RELATIONSHIP HZ_RELATIONSHIP_V2PUB : Data Type p_init_msg_list p_relationship_rec x_relationship_id x_party_id x_party_number x_return_status x_msg_count x_msg_data Procedure IN IN OUT OUT OUT OUT OUT OUT VARCHAR2:= FND_API. Start_Date.txt) b) The Value for Organization is accepted as a Parameter. x_party_number OUT VARCHAR2.

The Value for Parameter Object_Type should be one of the Values from the Column INSTANCE_SET_NAME from the table FND_OBJECT_INSTANCE_SETS . vi. and start date to create a relationship. xii. The subject type and the object type will be used to do the foreign key check for the subject id and the object id column. xvi. a party will be created for the relationship. Users are required to specify a subject id. The relationship code must be either a forward or backward relationship code defined in active records in the HZ_RELATIONSHIP_TYPES table for the relationship type. A record will be created in the HZ_RELATIONSHIPS table with the relationship Documentation on using TCA APIs . Only the relationship with both subject_table_name and object_table_name as 'HZ_PARTIES' can be denormalized to HZ_PARTIES table. The Value for Parameter Subject_Type should be one of the Values from the Column INSTANCE_SET_NAME from the table FND_OBJECT_INSTANCE_SETS . xiii. The Value for Parameter Object_Id should be one of the Values from the Column Object_Id from table FND_OBJECTS.V2 Page 46 . v. The value for Parameter Relationship_Type should be one of the Values defined for the Look Up Code PARTY_RELATIONS_TYPE . an object type. an object id. a subject type. The Value for Parameter Object_Table_Name should be one of the Values from the Column Obj_Name from table FND_OBJECTS. It will check the “denormalized to party” flag in the HZ_RELATIONSHIP_ TYPES table to see if a denormalized party is necessary. a relationship code. The subject id and the object id cannot be the same value unless the self related flag of the relationship type is set to yes. xv. a subject table name (where the subject belongs to. If the flag is set to yes. an object table name. HZ_PARTIES for subject type of ‘PERSON’. The subject id should be a valid object instance defined in the object instance set which is specified as the subject type. The Value for Parameter Subject_Id should be one of the Values from the Column Object_Id in FND_OBJECT_INSTANCE_SETS . The Value for Parameter Subject_Table_Name should be one of the values from the Column Obj_Name from table FND_OBJECTS. xi. xiv. x. ii. ‘ORGANIZATION’). two new records will be created in HZ_RELATIONSHIPS table. When user call the create relationship procedure. The object id should be a valid object instance defined in the object instance set which is specified as the object type. for example. viii. iii. The end date will be default to '31-DEC-4712' if not specified. The Value for Parameter Relationship_Code should be one of the Values for the Look Up Code PARTY_RELATIONS_TYPE . a relationship type. For a given subject_id.i. The end date must be greater than the start date. there can be no overlap of the start date and the end date. ix. iv. xvii. vii. relationship_code. object_id. Created_By_Moudle either from inside the API or at the SQL Prompt.

create_relationship( 'T'. x_return_status.V2 Page 47 .set_org_context('&Org_Id').255)).subject_id := '&Subject_Id'. dbms_output. x_relationship_id NUMBER.start_date := '&Start_Date'. The requested relationship will be created with directional_code value ‘F’ (meaning forward) and the reciprocal relationship will be created with directional_code value ‘B’ (meaning backward). BEGIN fnd_client_info. p_relationship_rec_type.object_table_name := UPPER ('&Object_Table_Name').255)).put_line('x_return_status = '|| SUBSTR (x_return_status. Example For Running Create Relationship API DECLARE p_relationship_rec_type HZ_RELATIONSHIP_V2PUB. x_party_number. p_relationship_rec_type.RELATIONSHIP_REC_TYPE.put_line('Party Number = '|| SUBSTR (x_party_number.relationship_code := UPPER ('&Relationship_Code').put_line('x_msg_count = '||TO_CHAR(x_msg_count)). p_relationship_rec_type. code Entered as input parameter. x_msg_count.subject_type := UPPER ('&Subject_Type'). dbms_output.put_line('x_msg_data = '|| SUBSTR (x_msg_data. x_return_status VARCHAR2(2000). hz_relationship_v2pub.object_id := '&Object_Id'.255)).subject_table_name := UPPER ('&Subject_Table_Name'). p_relationship_rec_type. x_party_id NUMBER. x_msg_count NUMBER. p_relationship_rec_type. and use it to create a second relationship.object_type := UPPER ('&Object_Type'). x_relationship_id. dbms_output. p_relationship_rec_type. p_relationship_rec_type.1. IF x_msg_count >1 THEN FOR I IN 1. x_party_id.put_line('Party Id = '||TO_CHAR(x_party_id)). dbms_output. x_party_number VARCHAR2(2000).1. p_relationship_rec_type. x_msg_data). It will find the 2 nd relationship code from the HZ_RELATIONSHIP_TYPES table.created_by_module := 'TCA_Example'. p_relationship_rec_type.x_msg_count LOOP Documentation on using TCA APIs . x_msg_data VARCHAR2(2000). The 2 nd relationship will have the same relationship_id and party_id as the first relationship..relationship_type := UPPER('&Relationship_Type'). dbms_output. dbms_output.1.xviii.put_line('Relationship Id ='||TO_CHAR(x_relationship_id)). p_relationship_rec_type. p_relationship_rec_type.

subject_id := '3906'.relationship_type := UPPER('&Relationship_Type').object_id := '&Object_Id'.dbms_output. Documentation on using TCA APIs . Sample Output of the Create Relationship Script Enter value for org_id: 204 old 11: fnd_client_info.set_org_context('&Org_Id'). END IF.set_org_context('204'). new 18: p_relationship_rec_type. Enter value for object_table_name: hz_parties old 18: p_relationship_rec_type. new 13: p_relationship_rec_type. new 19: p_relationship_rec_type.G_FALSE ).'||SUBSTR(FND_MSG_PUB.subject_table_name := UPPER ('hz_parties'). END. Enter value for subject_type: person old 16: p_relationship_rec_type. new 16: p_relationship_rec_type.object_id := '3903'.subject_type := UPPER ('&Subject_Type').object_table_name := UPPER ('&Object_Table_Name').subject_table_name := UPPER ('&Subject_Table_Name') new 15: p_relationship_rec_type. new 14: p_relationship_rec_type. Enter value for relationship_code: contact_of old 13: p_relationship_rec_type.Get(p_encoded=> FND_API. Enter value for relationship_type: contact old 12: p_relationship_rec_type.object_type := UPPER ('person'). new 20: p_relationship_rec_type. 1.start_date := '01-JAN-1952'. Enter value for object_id: 3903 old 17: p_relationship_rec_type. 255)). Enter value for subject_table_name: hz_parties old 15: p_relationship_rec_type.start_date := '&Start_Date'. Enter value for subject_id: 3906 old 14: p_relationship_rec_type. new 12: p_relationship_rec_type.subject_id := '&Subject_Id'. Enter value for start_date: 01-JAN-1952 old 20: p_relationship_rec_type. new 17: p_relationship_rec_type.relationship_code := UPPER ('&Relationship_Code').put_line(I||'.V2 Page 48 .object_table_name := UPPER ('hz_parties').relationship_type := UPPER ('contact').subject_type := UPPER ('person'). END LOOP. Enter value for object_type: person old 19: p_relationship_rec_type. new 11: fnd_client_info.object_type := UPPER ('&Object_Type').relationship_code := UPPER ('contact_of').

object_table_name. start_date FROM hz_relationships WHERE relationship_id = ‘3593’. relationship_type. Relationship_id = 3593 Subject_id = 3903 Subject_type = PERSON Subject_table_name = HZ_PARTIES Object_id = 3906 Object_type = PERSON Object_table_name = HZ_PARTIES Relationship_code = CONTACT Relationship_type = CONTACT Start_date = 01-JAN-52 Relationship_id = 3593 Subject_id = 3906 Subject_type = person Subject_table_name = HZ_PARTIES Object_id = 3903 Object_type = PERSON Object_table_name = HZ_PARTIES Relationship_code = CONTACT Relationship_type = CONTACT Start_date = 01-JAN-52 Documentation on using TCA APIs . relationship_code. object_id. subject_id. object_type.x_return_status = S x_msg_count = 0 Relationship Id =3593 Party Id = 3949 Party Number = 1881 x_msg_data = Script To Verify whether Create Relationship API is successful SELECT relationship_id.V2 Page 49 . subject_table_name. subject_type.

The Value for Parameter Allow_Multi_Parent_Flag must belong to a Lookup Code YES/NO. x_return_status OUT VARCHAR2.V2 Page 50 . c) Enter the values for the Parameters : Class_Category Allow_Multi_Parent_Flag Allow_Multi_Assign_Flag Allow_Leaf_Node_Flag from the SQL Prompt. x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Class Category API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN create_class_category.G_FALSE. The Value for Parameter Allow_Leaf_Node_Flag must belong to a Lookup Code YES/NO.G_FALSE CLASS_CATEGORY_REC_TYPE VARCHAR2 NUMBER VARCHAR2 Procedure PROCEDURE create_class_category( p_init_msg_list IN VARCHAR2:= FND_API. p_class_category_rec IN CLASS_CATEGORY_REC_TYPE. Example For Running Create Class Category API DECLARE Documentation on using TCA APIs . x_msg_count OUT NUMBER.txt) b) The Value for Organization Id is accepted as a Parameter.Example 12 : Create Class Category API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name Parameter Type : : : : CREATE CLASS CATEGORY HZ_CLASS_CATEGORIES CREATE_CLASS_CATEGORY HZ_CLASSIFICATION_V2PUB : Data Type p_init_msg_list p_class_category_rec x_return_status x_msg_count x_msg_data IN IN OUT OUT OUT VARCHAR2:= FND_API. The Value of the Parameter Class_Category must belong to a Lookup Code YES/NO.

255)).1. 1.allow_leaf_node_only_flag := UPPER ('&Leaf_Node_Flag').allow_multi_parent_flag := UPPER ('&Multi_Parent_Flag'). Enter value for multi_parent_flag: y old 11: p_class_category_rec.allow_multi_assign_flag := UPPER ('&Multi_Assign_Flag'). END LOOP.G_FALSE ). p_class_category_rec.create_class_category( 'T'.put_line('Allow Multi Parent Flag = '||p_class_category_rec. Sample Output of the Create Class Category Script Enter value for org_id: 204 old 8: fnd_client_info.255)). p_class_category_rec. dbms_output. BEGIN fnd_client_info. Enter value for multi_assign_flag: y old 10: p_class_category_rec. IF x_msg_count >1 THEN FOR I IN 1.set_org_context('204').allow_multi_assign_flag := UPPER ('&Multi_Assign_Flag').put_line('x_msg_count = '||TO_CHAR(x_msg_count)). p_class_category_rec. new 8: fnd_client_info. dbms_output. x_msg_count NUMBER. x_return_status VARCHAR2(2000). p_class_category_rec. END.created_by_module := 'TCA_Example'. Documentation on using TCA APIs . dbms_output.. dbms_output. x_msg_data VARCHAR2(2000).put_line('x_return_status = '||SUBSTR(x_return_status.set_org_context('&Org_Id').put_line('Class Category = '||p_class_category_rec.class_category := UPPER('&Class_Category').x_msg_count LOOP dbms_output.set_org_context('&Org_Id'). dbms_output. x_msg_data).'||SUBSTR(FND_MSG_PUB.class_category).put_line('x_msg_data = '|| SUBSTR (x_msg_data.V2 Page 51 .put_line(I||'. x_return_status.CLASS_CATEGORY_REC_TYPE.p_class_category_rec HZ_CLASSIFICATION_V2PUB. END IF. new 10: p_class_category_rec.255)). Enter value for class_category: account_classes old 9: p_class_category_rec. p_class_category_rec. new 9: p_class_category_rec. hz_classification_v2pub.1. p_class_category_rec.class_category := UPPER ('account_classes').allow_multi_parent_flag).class_category := UPPER('&Class_Category').allow_multi_parent_flag := UPPER ('&Multi_Parent_Flag').allow_multi_assign_flag := UPPER ('y'). x_msg_count.Get(p_encoded=> FND_API.

new 11: p_class_category_rec.allow_leaf_node_only_flag := UPPER ('&Leaf_Node_Flag').allow_multi_parent_flag := UPPER ('y'). Allow_Multi_Parent_Flag. class_category = ACCOUNT_CLASSES allow_multi_parent_flag = Y allow_multi_assign_flag = Y allow_leaf_node_only_flag = Y Documentation on using TCA APIs .allow_leaf_node_only_flag := UPPER ('y').V2 Page 52 . Allow_Multi_Assign_Flag. Enter value for leaf_node_flag: y old 12: p_class_category_rec. Allow_Leaf_Node_Only_Flag FROM hz_class_categories WHERE class_category = ‘Account_Classes’. x_return_status = S x_msg_count = 0 Class Category = ACCOUNT_CLASSES Allow Multi Parent Flag = Y x_msg_data = Script To Verify whether the Create Class Category API is successful SELECT Class_Category. new 12: p_class_category_rec.

For example if the value of the Parameter Owner_Table_Name is HZ_PARTIES then the a) Documentation on using TCA APIs . p_code_assignment_rec IN CODE_ASSIGNMENT_REC_TYPE. iii. x_code_assignment_id OUT NUMBER ) General Tips for Running the Create Code Assignment API Save the API in a script file and then run the script from the SQL Prompt (Example : RUN create_code_assignment. c) Enter the values for the Parameters : Owner_Table_Name Owner_Table_Id Class_Category Class_Code Primary_Flag Start_Date from the SQL Prompt.Example 13 : Create Code Assignment API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name Parameter Type : : : : : CREATE CODE ASSIGNMENT HZ_CODE_ASSIGNMENTS CREATE_CODE_ASSIGNMENT HZ_CLASSIFICATION_V2PUB Data Type p_init_msg_list p_code_assignment_rec x_return_status x_msg_count x_msg_data x_code_assignment_id Procedure IN IN OUT OUT OUT OUT VARCHAR2:= FND_API. i.txt) b) The Value for Organization Id is accepted as a Parameter. The Value for Parameter Owner_Table_Id must belong to a Column value of the Table_Name selected in Owner_Table_Name. x_msg_data OUT VARCHAR2.G_FALSE CODE_ASSIGNMENT_REC_TYPE VARCHAR2 NUMBER VARCHAR2 NUMBER PROCEDURE create_code_assignment( p_init_msg_list IN VARCHAR2:= FND_API. ii.V2 Page 53 . x_return_status OUT VARCHAR2. x_msg_count OUT NUMBER. The Value of the Parameter Owner_Table_Name must belong to a Lookup Code Code_Assign_Owner_Table.G_FALSE.

END LOOP.255)). BEGIN fnd_client_info. x_msg_count NUMBER. value of the Parameter Owner_Table_Id shall one of the values of the column PARTY_ID . hz_classification_v2pub. p_code_assignment_rec_type.put_line(I||'. x_code_assignment_id NUMBER. The Value for Parameter Class_Code must be one of the values given for the Lookup Code selected in (iii) above.x_msg_count LOOP dbms_output.create_code_assignment( 'T'. The Value for Parameter Primary_Flag must be Validated against the LookUp Code YES_NO .class_category)..put_line('Primary Flag = '||p_code_assignment_rec_type. p_code_assignment_rec_type. dbms_output.put_line('Owner Table Name = '||p_code_assignment_rec_type. p_code_assignment_rec_type. p_code_assignment_rec_type. dbms_output.CODE_ASSIGNMENT_REC_TYPE.255)).put_line('x_msg_data = '|| SUBSTR (x_msg_data. 255)). dbms_output.Get(p_encoded=> FND_API.owner_table_name). dbms_output. x_msg_count.put_line('Class Code = '||p_code_assignment_rec_type. IF x_msg_count >1 THEN FOR I IN 1. x_msg_data VARCHAR2(2000). x_code_assignment_id). x_msg_data. Example For Running Create Code Assignment API DECLARE p_code_assignment_rec_type HZ_CLASSIFICATION_V2PUB.primary_flag). x_return_status. Documentation on using TCA APIs .class_category := UPPER ('&Class_Category').put_line('x_msg_count = '||TO_CHAR(x_msg_count)).1. dbms_output.start_date_active := '&Start_Date_Active'. dbms_output.iv. x_return_status VARCHAR2(2000).'||SUBSTR(FND_MSG_PUB. p_code_assignment_rec_type.Primary_Flag := v('&Primary_Flag').put_line('Class Category = '||p_code_assignment_rec_type.class_code := UPPER ('&Class_Code'). dbms_output.V2 Page 54 . The Value for Parameter Class_Category must belong to the Column CLASS_CATEGORY from the table HZ_CLASS_CATEGORIES.put_line('x_return_status = '||SUBSTR(x_return_status. p_code_assignment_rec_type. vi. END IF. p_code_assignment_rec_type. p_code_assignment_rec_type.G_FALSE ).owner_table_name := UPPER('&Owner_Table_Name').1. dbms_output.created_by_module := 'TCA_Example'. v.set_org_context('&Org_Id'). 1.put_line('x_Code_Assignment_Id = '||TO_CHAR(x_code_assignment_id)).class_code).owner_table_id := &Owner_Table_Id.

Primary_Flag := UPPER ('&Primary_Flag'). owner_table_id.class_code := UPPER ('&Class_Code').start_date_active := '01-JAN-1952'.owner_table_id := &Owner_Table_Id.class_code := UPPER ('cash'). class_category. new 10: p_code_assignment_rec_type.V2 Page 55 . new 12: p_code_assignment_rec_type. x_return_status = S x_msg_count = 0 Owner Table Name = HZ_PARTIES Class Category = ACCOUNTING_METHOD Class Code = CASH Primary Flag = Y x_Code_Assignment_Id = 1131 x_msg_data = Script To Verify whether the Create Code Assignment API is successful SELECT code_assignment_id.END. Enter value for primary_flag: y old 14: p_code_assignment_rec_type. Sample Output of the Create Code Assignment Script Enter value for org_id: 204 old 9: fnd_client_info. new 9: fnd_client_info. new 11: p_code_assignment_rec_type. Enter value for class_code: cash old 13: p_code_assignment_rec_type.Primary_Flag := UPPER ('y').set_org_context('&Org_Id'). new 15: p_code_assignment_rec_type. owner_table_name. class_code. Enter value for class_category: accounting_method old 12: p_code_assignment_rec_type.class_category := UPPER ('accounting_method'). primary_flag FROM hz_code_assignments WHERE code_assignment_id = '1131'. Enter value for start_date_active: 01-JAN-1952 old 15: p_code_assignment_rec_type. Enter value for owner_table_name: hz_parties old 10: p_code_assignment_rec_type. new 14: p_code_assignment_rec_type.class_category := UPPER ('&Class_Category').start_date_active := '&Start_Date_Active'. new 13: p_code_assignment_rec_type.owner_table_name := UPPER ('hz_parties').owner_table_name := UPPER('&Owner_Table_Name'). code_assignment_id = 131 owner_table_name = HZ_PARTIES owner_table_id = 1000 Documentation on using TCA APIs . Enter value for owner_table_id: 1000 old 11: p_code_assignment_rec_type.set_org_context('204').owner_table_id := 1000.

class_category = ACCOUNTING_METHOD class_code = CASH primary_flag = Y Documentation on using TCA APIs .V2 Page 56 .

x_profile_id OUT NUMBER. x_account_number OUT VARCHAR2. G_TRUE.V2 Page 57 . x_party_number OUT VARCHAR2.PERSON_REC_TYPE HZ_ CUSTOMER_ PROFI LE_ V2PUB.PERSON_REC_TYPE.G_FALSE. x_party_id OUT NUMBER. x_return_status OUT VARCHAR2. p_cust_account_rec IN CUST_ACCOUNT_REC_TYPE. x_msg_count OUT NUMBER. p_create_profil e_amt IN VARCHAR2:= FND_API.Example 14 : Create Customer Account API Name of the API Base Tables Affected : : CREATE CUSTOMER ACCOUNT API HZ_CUST_ACCOUNTS HZ_CUSTOMER_PROFILES CREATE_CUST_ACCOUNT HZ_CUST_ACCOUNT_V2PUB PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name : : : Parameter Type Data Type p_init_msg_list p_cust_account_rec p_person_rec p_custome r_ prof ile_rec p_create_profil e_amt x_cust_account_id x_account_number x_party_id x_party_number x_profile_id x_return_status x_msg_count x_msg_data Procedure IN IN IN IN IN OUT OUT OUT OUT OUT OUT OUT OUT VARCHAR2:= FND_API. x_msg_data OUT VARCHAR2 ) Note: p_create_profile_amt indicates whether to create profile Documentation on using TCA APIs . x_cust_account_id OUT NUMBER.CUSTOMER_PROFILE_REC_TYPE VARCHAR2:= FND_API. p_person_rec IN HZ_PARTY_V2PUB.CUSTOMER_PROFILE_REC_TYPE.G_FALSE CUST_ACCOUNT_REC_TYPE HZ_PARTY_V2PUB. G_TRUE NUMBER VARCHAR2 NUMBER VARCHAR2 NUMBER VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_cust_account ( p_init_msg_list IN VARCHAR2:= FND_API. p _custome r_prof ile_rec IN HZ_CUSTOMER_ PROFI LE_ V2PUB.

x_cust_account_id. p_person_rec. p_person_rec HZ_PARTY_V2PUB. x_profile_id. BEGIN Fnd_client_info.PERSON_REC_TYPE.account_name := '&Customer_Name'. x_party_number. x_party_id NUMBER. p_cust_account_rec.G_TRUE. x_msg_data). x_msg_count.person_first_name := '&First_Name'. x_msg_data VARCHAR2(2000). x_msg_count NUMBER. p_person_rec.amounts for the customer profile being created.V2 Page 58 . profile amounts will be created by copying over the profile amounts for the profile class on which this customer profile is based.CUSTOMER_PROFILE_REC_TYPE.person_last_name := '&Last_Name'.created_by_module := 'TCA_EXAMPLE'.txt) b) Enter the Values for the Parameters Account Name. x_cust_account_id NUMBER. x_profile_id NUMBER. x_account_number VARCHAR2(2000). p_cust_account_rec. Example For Running a Create Customer Account API (Person) DECLARE p_cust_account_rec HZ_CUST_ACCOUNT_V2PUB. c) The Organization Id is accepted as a Parameter. p_customer_profile_rec HZ_CUSTOMER_PROFILE_V2PUB. p_person_rec. 'F'. General Tips for Running the Create Customer Account API (Person) a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN createperson. If value equals to FND_API. Documentation on using TCA APIs .set_org_context(‘&Org_Id’).CUST_ACCOUNT_REC_TYPE.create_cust_account( 'T'. x_account_number. x_return_status VARCHAR2(2000). hz_cust_account_v2pub. p_cust_account_rec. x_party_id. First Name and Last Name from the SQL prompt. x_party_number VARCHAR2(2000). x_return_status. p_customer_profile_rec.

Sample Output of the Create Customer Account Script (Person) Enter value for org_id: 204 old 14: Fnd_client_info.x_msg_count LOOP dbms_output.put_line('Party Number = '||x_party_number). END LOOP.V2 Page 59 .1. dbms_output.person_first_name := 'ISC'. new 14: Fnd_client_info. 1. dbms_output. dbms_output.put_line(I||'.put_line('x_msg_count = '||TO_CHAR(x_msg_count)). party_number. Enter value for first_name: ISC old 17: p_person_rec.put_line('x_msg_data = '|| SUBSTR (x_msg_data. 255))..set_org_context('204'). Enter value for last_name: US AR TEAM old 18: p_person_rec. party_id. new 15: p_cust_account_rec.dbms_output. new 18: p_person_rec.255)).put_line('Profile Id = '||TO_CHAR(x_profile_id)). Enter value for customer_name: ISC AR TEAM old 15: p_cust_account_rec.Get(p_encoded=> FND_API.'||SUBSTR(FND_MSG_PUB. party_id = 4113 Documentation on using TCA APIs .255)). dbms_output.G_FALSE ). party_name.1. cust_account_id = 3473 party_id = 4113 account_number = 1795 account_name = SELECT party_id.person_last_name := '&Last_Name'. dbms_output. account_number. x_return_status = S x_msg_count = 0 Party Id = 4113 Party Number = 2457 Profile Id = 2266 x_msg_data = Script To Verify whether Create Customer Account API (Person) is successful SELECT cust_account_id.put_line('Party Id = '||TO_CHAR(x_party_id)). IF x_msg_count >1 THEN FOR I IN 1. party_type FROM hz_parties WHERE party_id = 4113.put_line('x_return_status = '||SUBSTR(x_return_status. END IF. END. new 17: p_person_rec.set_org_context('&Org_Id').account_name := 'ISC AR TEAM'.account_name := '&Customer_Name'.person_first_name := '&First_Name'.person_last_name := 'US AR TEAM'. account_name FROM hz_cust_accounts WHERE party_id = 4113.

cust_account_id. person_profile_id = 2266 party_id = 4113 person_first_name = ISC person_last_name = US AR TEAM SELECT cust_account_profile_id. person_first_name. collector_id FROM hz_customer_profiles WHERE cust_account_id = 3473. profile_class_id.V2 Page 60 . person_last_name FROM hz_person_profiles WHERE party_id = 4113.party_number = 2457 party_name = ISC US AR TEAM party_type = PERSON SELECT person_profile_id. cust_account_profile_id = 4144 cust_account_id = 3473 profile_class_id = 0 collector = 1000 Documentation on using TCA APIs . party_id.

Documentation on using TCA APIs . x_return_status OUT VARCHAR2. p_object_version_number IN OUT NUMBER.CUST_ACCOUNT_REC_TYPE.G_FALSE. x_msg_data OUT VARCHAR2 ) General Tips for Running the Update Customer Account API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN updatecustacct.G_FALSE CUST_ACCOUNT_REC_TYPE NUMBER VARCHAR2 NUMBER VARCHAR2 PROCEDURE update_cust_account ( p_init_msg_list IN VARCHAR2:= FND_API.Example 15 : Update Customer Account API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name : : : : : Parameter Type UPDATE CUSTOMER ACCOUNT HZ_CUST_ACCOUNTS UPDATE_CUST_ACCOUNT HZ_CUST_ACCOUNT_V2PUB Data Type p_init_msg_list p_cust_account_rec p_object_version_number x_return_status x_msg_count x_msg_data Procedure IN IN IN OUT OUT OUT OUT VARCHAR2:= FND_API. d) The Value for Organization is accepted as a Parameter.txt) b) Enter the values for the Cust_Account_Id and Customer_Type from the SQL prompt itself as hard coding these two parameters means the script has to be changed for the value of these two parameters each time a Customer Account is Updated. p_object_version_number NUMBER.V2 Page 61 . p_cust_account_rec IN CUST_ACCOUNT_REC_TYPE. Example For Running Update Customer Account Record API DECLARE p_cust_account_rec HZ_CUST_ACCOUNT_V2PUB. x_return_status VARCHAR2(2000). x_msg_count OUT NUMBER. c) To Select the Customer Account Id run the query: SELECT cust_account_id FROM hz_cust_accounts.

put_line('x_msg_data = '|| SUBSTR (x_msg_data. p_object_version_number := 1.G_FALSE ).'||SUBSTR(FND_MSG_PUB.set_org_context('204').put_line(I||'. p_cust_account_rec.set_org_context('&Org_Id').cust_account_id := 3473.255)). BEGIN fnd_client_info. x_msg_data).customer_type := '&Customer_Type'.update_cust_account( 'T'.put_line('x_msg_count = '||TO_CHAR(x_msg_count)). Sample Output of the Update Customer Account Record Script Enter value for org_id: 204 old 8: fnd_client_info.G_MISS_CHAR.customer_type := 'R'.cust_account_id := &Customer_Account_Id. p_cust_account_rec. p_cust_account_rec. END LOOP. dbms_output.1. new 10: p_cust_account_rec. IF x_msg_count >1 THEN FOR I IN 1. END.Get(p_encoded=> FND_API. Enter value for customer_type: R old 10: p_cust_account_rec.V2 Page 62 . x_return_status = S x_msg_count = 0 Object Version Number =2 x_msg_data = Documentation on using TCA APIs .account_name := FND_API.255)). dbms_output. 255)).. 1.cust_account_id := &Customer_Account_Id.set_org_context('&Org_Id'). x_return_status.x_msg_count NUMBER. x_msg_data VARCHAR2(2000).put_line('Object Version Number ='||TO_CHAR(p_object_version_number)). p_object_version_number.customer_type := '&Customer_Type'.put_line('x_return_status = '||SUBSTR(x_return_status. p_cust_account_rec.1. x_msg_count. END IF. dbms_output. new 9: p_cust_account_rec. hz_cust_account_v2pub. dbms_output. Enter value for customer_account_id: 3473 old 9: p_cust_account_rec.x_msg_count LOOP dbms_output. new 8: fnd_client_info.

account_name FROM hz_cust_accounts WHERE cust_account_id = 3473.V2 Page 63 .Script To Verify whether the Update Customer Account API is successful SELECT cust_account_id. customer_type. cust_account_id = 3473 customer_type = R account_name = ‘ ‘ Documentation on using TCA APIs .

txt) Enter the values for the Cust_Account_Id and Party_Site_id from the SQL prompt itself as hard coding these two parameters means the script has to be changed for the value of these two parameters each time a new Customer Account Site is created.cust_acct_site_rec_type.V2 Page 64 . x_msg_count OUT NUMBER. To Select the Customer Account Id run the query: SELECT cust_account_id FROM hz_cust_accounts. Example For Running a Create Customer Account Site API DECLARE p_cust_acct_site_rec hz_cust_account_site_v2pub.G_FALSE CUST_ACCT_SITE_REC_TYPE NUMBER VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_cust_acct_site ( p_init_msg_list IN VARCHAR2:= FND_API. x_cust_acct_site_id OUT NUMBER. p_cust_acct_site_rec IN CUST_ACCT_SITE_REC_TYPE. Set the organization id before running the script as : EXEC fnd_client_info.Example 16 : Create Customer Account API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name Parameter Type : : : : : CREATE CUSTOMER ACCOUNT SITE HZ_CUST_ACCT_SITES CREATE_CUST_ACCT_SITE HZ_CUST_ACCOUNT_SITE_V2PUB Data Type p_init_msg_list p_cust_acct_site_rec x_cust_acct_site_id x_return_status x_msg_count x_msg_data Procedure IN IN OUT OUT OUT OUT VARCHAR2:= FND_API.set_org_context('<orgid>'). x_return_status OUT VARCHAR2. To Select the Party Site Id run the Query : SELECT party_site_id FROM hz_party_sites. x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Customer Account Site API a) b) c) d) e) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN createcustacctsite. Documentation on using TCA APIs .G_FALSE.

p_cust_acct_site_rec.put_line('x_msg_data = '|| SUBSTR(x_msg_data. x_cust_acct_site_id NUMBER. p_cust_acct_site_rec.put_line('x_return_status = '||SUBSTR(x_return_status.party_site_id := &Party_Site_Id.party_site_id := 3450. x_return_status = S x_msg_count = 0 Customer Account Site Id is = 3707 x_msg_data = Script To Verify whether the Create Customer Account Site API is successful SELECT cust_acct_site_id.1. x_cust_acct_site_id. x_msg_count. x_msg_data).put_line(I||'. x_msg_data VARCHAR2(2000).create_cust_acct_site( 'T'.x_msg_count LOOP dbms_output. org_id FROM hz_cust_acct_sites_all WHERE cust_acct_site_id = 3707. Sample Output of the Create Customer Account Site Script Enter value for customer_account_id: 3473 old 8: p_cust_acct_site_rec. x_msg_count NUMBER.. dbms_output. party_site_id. END IF.cust_account_id := 3473.V2 Page 65 . x_return_status. END LOOP. dbms_output.255)).language := 'US'. IF x_msg_count >1 THEN FOR I IN 1.1.put_line('Customer Account Site Id is = '||TO_CHAR(x_cust_acct_site_id)). END.party_site_id := &Party_Site_Id.G_FALSE ).created_by_module := 'TCA-EXAMPLE'. new 9: p_cust_acct_site_rec.255)). Enter value for party_site_id: 3450 old 9: p_cust_acct_site_rec.cust_account_id := &Customer_Account_Id. new 8: p_cust_acct_site_rec.cust_account_id := &Customer_Account_Id.x_return_status VARCHAR2(2000). cust_account_id. p_cust_acct_site_rec. dbms_output.'||SUBSTR(FND_MSG_PUB.Get(p_encoded=> FND_API. 255)).put_line('x_msg_count = '||TO_CHAR(x_msg_count)). dbms_output. Documentation on using TCA APIs . BEGIN p_cust_acct_site_rec. 1. hz_cust_account_site_v2pub. p_cust_acct_site_rec.

V2 Page 66 .cust_acct_site_id = 3707 cust_account_id = 3473 party_site_id = 3450 org_id = 204 Documentation on using TCA APIs .

If value equals to FND_API. p_create_profile IN VARCHAR2:= FND_API.Example 17 : Update Customer Account Site Use API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name : : : : : Parameter Type CREATE CUSTOMER ACCOUNT SITE USE HZ_CUST_SITE_USES CREATE_CUST_SITE_USE HZ_CUST_ACCOUNT_SITE_V2PUB Data Type p_init_msg_list p_cust_site_use_rec p_customer_profile_rec p_create_profile p_create_profile_amt x_site_use_id x_return_status x_msg_count x_msg_data Procedure IN IN IN IN IN OUT OUT OUT OUT VARCHAR2:= FND_API.G_TRUE. a profile will be created.G_ TRUE. x_return_status OUT VARCHAR2.V2 Page 67 . Similarly. p_customer_ profile_rec IN HZ_CUSTOMER_PROFI LE_ V2PUB. x_msg_count OUT NUMBER. p_create_ profile_amt is processed only when p_create_profile equals to FND_API.G_TRUE. x_msg_data OUT VARCHAR2 ) Note: p_create_profile indicates whether to create customer profile for the site use being created. x_site_use_id OUT NUMBER. profile amounts will be created by copying over the profile amounts for the profile class on which this customer profile is based. p_create_profile_amt indicates whether to create profile amounts for the customer profile being created. CUSTOMER_PROFILE_REC_TYPE VARCHAR2:=FND_API.G_FALSE CUST_SITE_USE_REC_TYPE HZ_CUSTOMER_PROFILE_V2PUB.G_TRUE VARCHAR2:=FND_API.G_TRUE.G_TRUE. p_cust_site_use_rec IN CUST_SITE_USE_REC_TYPE.G_FALSE.G_TRUE NUMBER VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_cust_site_use ( p_init_msg_list IN VARCHAR2:= FND_API. If value equals to FND_API.CUSTOMER_PROFILE_REC_TYPE. p_create_profile_amt IN VARCHAR2:= FND_API. Documentation on using TCA APIs .

x_return_status. IF x_msg_count >1 THEN FOR I IN 1.1. p_customer_profile_rec.put_line('x_return_status = '||SUBSTR(x_return_status. x_msg_count NUMBER. x_site_use_id. x_msg_data). hz_cust_account_site_v2pub. x_return_status VARCHAR2(2000).put_line('x_msg_count = '||TO_CHAR(x_msg_count)).'||SUBSTR(FND_MSG_PUB.site_use_code := '&Site_Use'. 1.put_line('Site Use Id = '||TO_CHAR(x_site_use_id)). BEGIN fnd_client_info.255)). dbms_output.255)).255)).created_by_module := 'TCA_EXAMPLE'.put_line(I||'. x_msg_count. dbms_output. dbms_output. d) The Value for Organization is accepted as a Parameter. dbms_output. Site_Use and Location from the SQL prompt itself as hard coding these two parameters means the script has to be changed for the value of these two parameters each time a new Customer Account Site is created. p_cust_site_use_rec. Example For Running a Create Customer Account Site Use API DECLARE p_cust_site_use_rec HZ_CUST_ACCOUNT_SITE_V2PUB. ''. c) To Select the Customer Account Site Id run the query: SELECT cust_acct_site_id FROM hz_cust_acct_sites.cust_acct_site_id := &Customer_Account_Site_Id.General Tips for Running the Create Customer Account Site Use API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN custacctsiteuse. p_customer_profile_rec HZ_CUSTOMER_PROFILE_V2PUB. dbms_output.site_use_code. x_site_use_id NUMBER.1. p_cust_site_use_rec.put_line('Site Use = '|| SUBSTR (p_cust_site_use_rec. p_cust_site_use_rec.create_cust_site_use( 'T'. x_msg_data VARCHAR2(2000).1.V2 Page 68 .G_FALSE ). ''.set_org_context('&Org_Id').put_line('x_msg_data = '|| SUBSTR (x_msg_data.CUST_SITE_USE_REC_TYPE.CUSTOMER_PROFILE_REC_TYPE. p_cust_site_use_rec.Get(p_encoded=> FND_API. Documentation on using TCA APIs .txt) b) Enter the values for the Cust_Account_Site_Id .x_msg_count LOOP dbms_output. 255)). p_cust_site_use_rec.location := '&Location'.. END LOOP.

END.location := '&Location'.location := 'NEW LOCATION'.END IF. Sample Output of the Create Customer Account Site Use Script Enter value for org_id: 204 old 9: fnd_client_info. Enter value for location: NEW LOCATION old 12: p_cust_site_use_rec. new 9: fnd_client_info.set_org_context('204'). new 10: p_cust_site_use_rec. site_use_code. Enter value for customer_account_site_id: 3461 old 10: p_cust_site_use_rec. cust_acct_site_id.set_org_context('&Org_Id'). new 11: p_cust_site_use_rec.site_use_code := 'INV'.cust_acct_site_id := &Customer_Account_Site_Id. new 12: p_cust_site_use_rec.site_use_code := '&Site_Use'. org_id FROM hz_cust_site_uses_all WHERE site_use_id = 3703. location.V2 Page 69 .cust_acct_site_id := 3461. Enter value for site_use: INV old 11: p_cust_site_use_rec. site_use_id = 3703 cust_acct_site_id = 3461 site_use_code = INV location = NEW LOCATION org_id = 204 Documentation on using TCA APIs . x_return_status = S x_msg_count = 0 Site Use Id = 3703 Site Use = INV x_msg_data = Script To Verify whether the Create Customer Account Site Use API is successful SELECT site_use_id.

G_TRUE NUMBER VARCHAR2 NUMBER VARCHAR2 PROCEDURE create_customer_profile ( p_init_msg_list IN VARCHAR2:= FND_API.G_FALSE CUSTOMER_ PROFI LE_ REC_ TYPE VARCHAR2:= FND_API.V2 Page 70 . x_cust_account_profile_id NUMBER. x_msg_data OUT VARCHAR2 ) General Tips for Running the Create Customer Profile API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN create_customer_profile.txt) b) The Value for Organization is also accepted as a Parameter. x_return_status OUT VARCHAR2. c) Enter the values for the Parameter cust_account_id from the SQL Prompt or from within API itself as a fixed value. x_msg_count OUT NUMBER. x_return_status VARCHAR2(2000). Documentation on using TCA APIs . x_cust_account_profile_id OUT NUMBER. d) The Cust_Account_Id must exists in hz_cust_accounts.CUSTOMER_PROFILE_REC_TYPE.Example 18 : Create Customer Profile API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name : : : : : CREATE CUSTOMER PROFILE HZ_CUSTOMER_PROFILES CREATE_CUSTOMER_PROFILE HZ_CUSTOMER_PROFILE_V2PUB Parameter Type Data Type p_init_msg_list p _ customer _prof ile_rec p_create_profil e_amt x_cust_account_profile_id x_return_status x_msg_count x_msg_data Procedure IN IN IN OUT OUT OUT OUT VARCHAR2:= FND_API. G_TRUE. Example For Running Create Customer Profile API DECLARE p_customer_profile_rec_type HZ_CUSTOMER_PROFILE_V2PUB. p_create_profil e_amt IN VARCHAR2:= FND_API.G_FALSE. p _ c us t ome r _ profile_ rec IN CUSTOMER_ PROFI LE_ REC_ TYPE.

put_line(I||'. 'T'.put_line('x_return_status = '||SUBSTR(x_return_status.cust_account_id := '&Cust_Account_Id'. dbms_output. END.set_org_context('&Org_Id'). p_customer_profile_rec_type.G_FALSE ).put_line('Cust Account Id = '||TO_CHAR(p_customer_profile_rec_type. dbms_output. x_return_status = S Cust Account Id = 1307 Cust Account Profile Id = 4425 Status = Credit Checking = Interest Charges = Documentation on using TCA APIs . dbms_output. p_customer_profile_rec_type.created_by_module := 'TCA_Example'.put_line('Credit Checking = '||p_customer_profile_rec_type. x_msg_data)..cust_account_id)). hz_customer_profile_v2pub.cust_account_id := '1307'. 255)).x_msg_count NUMBER. dbms_output.255)).set_org_context('204'). IF x_msg_count >1 THEN FOR I IN 1.create_customer_profile( 'T'.1. Sample Output of the Create Customer Profile Script Enter value for org_id: 204 old 9: fnd_client_info. x_return_status.put_line('x_msg_data = '|| SUBSTR (x_msg_data.Get(p_encoded=> FND_API.cust_account_id := '&Cust_Account_Id'.put_line('Status = '||p_customer_profile_rec_type. x_cust_account_profile_id. dbms_output. dbms_output.'||SUBSTR(FND_MSG_PUB.credit_checking).put_line('Interest Charges = '||p_customer_profile_rec_type. dbms_output.x_msg_count LOOP dbms_output. END IF. Enter value for cust_account_id: 1307 old 10: p_customer_profile_rec_type.put_line('Cust Account Profile Id = '||TO_CHAR(x_cust_account_profile_id)). p_customer_profile_rec_type.V2 Page 71 . BEGIN fnd_client_info.status).put_line('x_msg_count = '||TO_CHAR(x_msg_count)). dbms_output. x_msg_count.interest_charges).255)). END LOOP.set_org_context('&Org_Id').1. new 10: p_customer_profile_rec_type. new 9: fnd_client_info. x_msg_data VARCHAR2(2000). 1.

created_by_module FROM hz_customer_profiles WHERE cust_account_profile_id = '4425'.x_msg_count = 0 x_msg_data = Script To Verify whether the Create Customer Profile API is successful SELECT cust_account_profile_id. Cust_account_profile_id = 4425 Creation_date = 22-APR-02 Cust_account_id = 1307 Status = A Created_by_module = TCA_EXAMPLE Documentation on using TCA APIs . status. cust_account_id. creation_date.V2 Page 72 .

NUMBER. VARCHAR2 PROCEDURE update_customer_profile ( p_init_msg_list IN VARCHAR2:= FND_API. x_return_status OUT VARCHAR2. Example For Running Update Customer Profile API DECLARE p_customer_profile_rec_type HZ_CUSTOMER_PROFILE_V2PUB.G_FALSE. x_msg_count NUMBER.txt) b) The Value for Organization is also accepted as a Parameter. p_object_version_number IN OUT NUMBER.G_FALSE.CUSTOMER_PROFILE_REC_TYPE. CUSTOMER_ PROFI LE_ REC_ TYPE.Example 19 : Update Customer Profile API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name : : : : : Parameter Type UPDATE CUSTOMER PROFILE HZ_CUSTOMER_PROFILES UPDATE_CUSTOMER_PROFILE HZ_CUSTOMER_PROFILE_V2PUB Data Type p_init_msg_list p_customer_ profile_rec p_object_version_number x_return_status x_msg_count x_msg_data Procedure IN IN IN OUT OUT OUT OUT VARCHAR2:= FND_API. x_msg_data OUT VARCHAR2 ) General Tips for Running the Update Customer Profile API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN update_customer_profile. p _ c us t omer _ profile_rec I N CUSTOMER_ PROFI LE_ REC_ TYPE. x_msg_count OUT NUMBER.V2 Page 73 . BEGIN fnd_client_info. VARCHAR2. NUMBER. x_return_status VARCHAR2(2000). x_msg_data VARCHAR2(2000).cust_account_profile_id := '&Cust_Account_Profile_Id'.set_org_context('&Org_Id'). p_object_version_number NUMBER. p_customer_profile_rec_type. p_cust_account_profile_id NUMBER. Documentation on using TCA APIs .

new 10: fnd_client_info.put_line('Object Version Number = '||TO_CHAR(p_object_version_number)).put_line(I||'.put_line('x_msg_count = '||TO_CHAR(x_msg_count)).1.V2 Page 74 .Get(p_encoded=> FND_API.cust_account_profile_id := '1017'.G_FALSE ). dbms_output.255)). hz_customer_profile_v2pub. Enter value for cust_account_profile_id: 1017 old 11: p_customer_profile_rec_type. x_msg_data).put_line('Credit Rating = '||p_customer_profile_rec_type. p_object_version_number. new 12: p_customer_profile_rec_type.credit_rating := '&New_Credit_Rating'. END. dbms_output.set_org_context('204').255)).credit_rating := 'Poor'. x_return_status = S Object Version Number = 2 Credit Rating = Poor x_msg_count = 0 x_msg_data = Script To Verify whether the Update Customer Profile API is successful SELECT cust_account_profile_id.1. dbms_output. x_return_status. 255)).x_msg_count LOOP dbms_output.'||SUBSTR(FND_MSG_PUB.credit_rating := '&New_Credit_Rating'. 1.cust_account_profile_id := '&Cust_Account_Profile_Id'. x_msg_count. Enter value for new_credit_rating: Poor old 12: p_customer_profile_rec_type.p_customer_profile_rec_type. status.put_line('x_msg_data = '|| SUBSTR (x_msg_data.. IF x_msg_count >1 THEN FOR I IN 1. p_object_version_number := ‘&object_version_number. Sample Output of the Update Customer Profile Script Enter value for org_id: 204 old 10: fnd_client_info. new 11: p_customer_profile_rec_type. cust_account_profile_id = 1017 cust_account_id = 1008 Documentation on using TCA APIs . dbms_output.credit_rating). cust_account_id. dbms_output.put_line('x_return_status = '||SUBSTR(x_return_status. END LOOP. END IF.update_customer_profile( 'T'.set_org_context('&Org_Id'). credit_checking FROM hz_customer_profiles WHERE cust_account_profile_id = '1017'. p_customer_profile_rec_type.

status = A credit_checking = Y Documentation on using TCA APIs .V2 Page 75 .

p_created_by_module VARCHAR2(500).G_FALSE. p_location_id IN NUMBER. x_return_status IN OUT VARCHAR2 . p_application_id IN NUMBER.V2 Page 76 . Documentation on using TCA APIs . p_created_by_module IN VARCHAR2.G_FALSE NUMBER VARCHAR2:= FND_API. x_loc_id OUT NUMBER ) General Tips for Running the Create Location Assignment API a) Save the API in a script file and then run the script from the SQL Prompt (Example : RUN create_loc_assignment. x_msg_data OUT VARCHAR2.Example 20 : Create Location Assignment API Name of the API Base Tables Affected PL/SQL Procedure used Package Used Mandatory Parameters Parameter Name : : : : : Parameter Type UPDATE CUSTOMER PROFILE HZ_LOC_ASSIGNMENTS CREATE_LOC_ASSIGNMENT HZ_TAX_ASSIGNMENT_V2PUB Data Type p_init_msg_list p_location_id p_lock_flag p_created_by_module p_application_id x_return_status x_msg_count x_msg_data x_loc_id Procedure IN IN IN IN IN IN OUT OUT OUT OUT VARCHAR2:= FND_API.txt) b) The Value for Organization is accepted as a Parameter. Example For Running Create Location Assignment API DECLARE p_location_id NUMBER. c) Enter the value of the Parameter Location_Id as a value which exists in HZ_LOCATIONS table. p_lock_flag IN VARCHAR2:= FND_API. NUMBER VARCHAR2 NUMBER PROCEDURE create_loc_assignment( p_init_msg_list IN VARCHAR2:= FND_API.G_FALSE. x_msg_count OUT NUMBER.G_FALSE VARCHAR2 NUMBER VARCHAR2.

V2 Page 77 . x_loc_id NUMBER.put_line(I||'. IF x_msg_count >1 THEN FOR I IN 1. 'T'. x_return_status = S Location Id = 5624 Created By Moudle = TCA_Example x_msg_count = 0 Documentation on using TCA APIs .put_line('Created By Moudle = '|| SUBSTR (p_created_by_module.set_org_context('&Org_Id'). BEGIN fnd_client_info. p_created_by_module := 'TCA_Example'.1. new 11: fnd_client_info.30)). END.create_loc_assignment( 'T'. x_loc_id). dbms_output.'||SUBSTR(FND_MSG_PUB. x_msg_count NUMBER.G_FALSE ). dbms_output.put_line('Location Id = '||TO_CHAR(p_location_id)). new 12: p_location_id := '5624'. x_return_status VARCHAR2(2000). hz_tax_assignment_v2pub.1.255)).1. x_msg_data.put_line('x_return_status = '||SUBSTR(x_return_status. dbms_output. Enter value for location_id: 5624 old 12: p_location_id := '&Location_Id'. p_location_id..255)). 1. p_location_id := '&Location_Id'.x_msg_count LOOP dbms_output. x_return_status. p_created_by_module. x_msg_count. END IF.put_line('x_msg_data = '|| SUBSTR (x_msg_data. dbms_output. x_msg_data VARCHAR2(2000).p_application_id NUMBER. dbms_output. 255)).Get(p_encoded=> FND_API. END LOOP. p_application_id.set_org_context('204'). Sample Output of the Create Location Assignment Script Enter value for org_id: 204 old 11: fnd_client_info.put_line('x_msg_count = '||TO_CHAR(x_msg_count)).set_org_context('&Org_Id').

Location_id = 5624 Loc_id = ‘ ‘ Org_id = 204 Created_by = -1 Created_by_module = TCA_EXAMPLE Documentation on using TCA APIs . created_by_module FROM hz_loc_assignments WHERE location_id = '5624'.V2 Page 78 . created_by. loc_id. org_id.x_msg_data = Script To Verify whether the Create Location Assignment API is successful SELECT location_id.

V2 Page 79 . db_rating VARCHAR2(5). paydex_norm VARCHAR2(3). PL/SQL Record Structure for Organization TYPE organization_rec_type IS RECORD( organization_name VARCHAR2(360).pls files. rent_own_ind VARCHAR2(30). duns_number_c VARCHAR2(30). employees_total NUMBER. branch_flag VARCHAR2(1). hq_branch_ind VARCHAR2(30). global_failure_score VARCHAR2(5). When the HZ Patchsets are applied the PL/SQL record structures will be available as part of . principal_name VARCHAR2(240).PL/SQL RECORD STRUCTURES USED BY TCA APIS These Record Structures need not be created by the user. disadv_8a_ind VARCHAR2(30). Documentation on using TCA APIs . small_bus_ind VARCHAR2(30). failure_score_commentary VARCHAR2(30). failure_score VARCHAR2(30). ceo_title VARCHAR2(240). export_ind VARCHAR2(30). sic_code VARCHAR2(30). paydex_score VARCHAR2(3). credit_score VARCHAR2(30). labor_surplus_ind VARCHAR2(30). failure_score_natnl_percentile NUMBER. ceo_name VARCHAR2(240). oob_ind VARCHAR2(30). minority_owned_type VARCHAR2(30). cong_dist_code VARCHAR2(2). failure_score_override_code VARCHAR2(30). control_yr NUMBER. enquiry_duns VARCHAR2(15). legal_status VARCHAR2(30). line_of_business VARCHAR2(240). import_ind VARCHAR2(30). paydex_three_months_ago VARCHAR2(3). credit_score_commentary VARCHAR2(30). woman_owned_ind VARCHAR2(30). debarments_date DATE. debarments_count NUMBER. debarment_ind VARCHAR2(30). principal_title VARCHAR2(240). minority_owned_ind VARCHAR2(30).

emp_at_primary_adr VARCHAR2(10). credit_score_class NUMBER. pref_functional_currency VARCHAR2(30). local_activity_code VARCHAR2(30). emp_at_primary_adr_min_ind VARCHAR2(30). best_time_contact_end DATE. credit_score_incd_default NUMBER. credit_score_age NUMBER. local_activity_code_type VARCHAR2(30). known_as2 VARCHAR2(240). known_as3 VARCHAR2(240). credit_score_natl_percentile NUMBER. local_bus_identifier VARCHAR2(60). year_established NUMBER. next_fy_potential_revenue NUMBER. sic_code_type VARCHAR2(30). corporation_class VARCHAR2(60). parent_sub_ind VARCHAR2(30). high_credit NUMBER. registration_type VARCHAR2(30). organization_type VARCHAR2(30). known_as4 VARCHAR2(240). incorp_year NUMBER. emp_at_primary_adr_text VARCHAR2(12). total_emp_est_ind VARCHAR2(30). tax_reference VARCHAR2(50). business_scope VARCHAR2(20). total_employees_text VARCHAR2(60).V2 Page 80 . emp_at_primary_adr_est_ind VARCHAR2(30). total_payments NUMBER. gsa_indicator_flag VARCHAR2(1). avg_high_credit NUMBER. organization_name_phonetic VARCHAR2(320). total_emp_min_ind VARCHAR2(30). local_bus_iden_type VARCHAR2(30). public_private_ownership_flag VARCHAR2(1). mission_statement VARCHAR2(2000). known_as VARCHAR2(240). curr_fy_potential_revenue NUMBER. Documentation on using TCA APIs . known_as5 VARCHAR2(240).best_time_contact_begin DATE. internal_flag VARCHAR2(30). total_employees_ind VARCHAR2(30). jgzz_fiscal_code VARCHAR2(20). analysis_fy VARCHAR2(5). fiscal_yearend_month VARCHAR2(30).

attribute16 VARCHAR2(150). attribute7 VARCHAR2(150). failure_score_commentary8 VARCHAR2(30). failure_score_commentary10 VARCHAR2(30). failure_score_commentary4 VARCHAR2(30). credit_score_commentary9 VARCHAR2(30). credit_score_commentary4 VARCHAR2(30). attribute_category VARCHAR2(30). Documentation on using TCA APIs . attribute15 VARCHAR2(150). failure_score_commentary2 VARCHAR2(30). attribute8 VARCHAR2(150). attribute13 VARCHAR2(150). credit_score_commentary5 VARCHAR2(30). attribute3 VARCHAR2(150). failure_score_commentary3 VARCHAR2(30). failure_score_incd_default NUMBER. failure_score_commentary6 VARCHAR2(30). failure_score_date DATE. failure_score_age NUMBER. attribute2 VARCHAR2(150). attribute12 VARCHAR2(150). attribute6 VARCHAR2(150).credit_score_date DATE. maximum_credit_currency_code VARCHAR2(240). attribute10 VARCHAR2(150). credit_score_commentary2 VARCHAR2(30).V2 Page 81 . content_source_number VARCHAR2(30). failure_score_commentary7 VARCHAR2(30). displayed_duns_party_id NUMBER. credit_score_commentary3 VARCHAR2(30). credit_score_commentary7 VARCHAR2(30). maximum_credit_recommendation NUMBER. credit_score_commentary10 VARCHAR2(30). attribute11 VARCHAR2(150). failure_score_commentary9 VARCHAR2(30). credit_score_commentary8 VARCHAR2(30). failure_score_class NUMBER. content_source_type VARCHAR2(30). attribute1 VARCHAR2(150). attribute17 VARCHAR2(150). credit_score_commentary6 VARCHAR2(30). attribute9 VARCHAR2(150). attribute5 VARCHAR2(150). attribute4 VARCHAR2(150). attribute14 VARCHAR2(150). failure_score_commentary5 VARCHAR2(30).

person_last_name VARCHAR2(150). declared_ethnicity VARCHAR2(60). person_first_name_phonetic VARCHAR2(60). marital_status_effective_date DATE. attribute20 VARCHAR2(150). person_iden_type VARCHAR2(30). date_of_death DATE. attribute19 VARCHAR2(150).attribute18 VARCHAR2(150). person_last_name_phonetic VARCHAR2(60). person_title VARCHAR2(60). party_rec PARTY_REC_TYPE:= G_MISS_PARTY _REC ) PL/SQL Record Structure for Person TYPE person_rec_type IS RECORD( person_pre_name_adjunct VARCHAR2(30). date_of_birth DATE. rent_own_ind VARCHAR2(30). created_by_module VARCHAR2(150). person_academic_title VARCHAR2(30). known_as5 VARCHAR2(240). person_first_name VARCHAR2(150). middle_name_phonetic VARCHAR2(60). place_of_birth VARCHAR2(60). known_as2 VARCHAR2(240). application_id NUMBER. household_size NUMBER. head_of_household_flag VARCHAR2(1). known_as4 VARCHAR2(240). Documentation on using TCA APIs . tax_reference VARCHAR2(50). gender VARCHAR2(30).V2 Page 82 . person_middle_name VARCHAR2(60). person_previous_last_name VARCHAR2(150). jgzz_fiscal_code VARCHAR2(20). person_identifier VARCHAR2(60). person_initials VARCHAR2(6). marital_status VARCHAR2(30). known_as3 VARCHAR2(240). personal_income NUMBER. household_income NUMBER. known_as VARCHAR2(240). person_name_suffix VARCHAR2(30). person_name_phonetic VARCHAR2(320).

attribute14 VARCHAR2(150). Documentation on using TCA APIs . attribute9 VARCHAR2(150). attribute6 VARCHAR2(150). attribute3 VARCHAR2(150).last_known_gps VARCHAR2(60). content_source_type VARCHAR2(30):= G_MISS_CONTENT_ SOURCE_TYPE.V2 Page 83 . internal_flag VARCHAR2(2). created_by_module VARCHAR2(150). attribute5 VARCHAR2(150). created_by_module VARCHAR2(150). party_rec PARTY_REC_TYPE:= G_MISS_PARTY_REC ) PL/SQL Record Structure for Organization Contact TYPE org_contact_rec_type IS RECORD( org_contact_id NUMBER. party_rec PARTY_REC_TYPE:= G_MISS_PARTY_REC ) PL/SQL Record Structure for Group TYPE group_rec_type IS RECORD( group_name VARCHAR2(255). attribute20 VARCHAR2(150). group_type VARCHAR2(30). attribute4 VARCHAR2(150). comments VARCHAR2(240). attribute11 VARCHAR2(150). application_id NUMBER. attribute_category VARCHAR2(30). attribute16 VARCHAR2(150). attribute18 VARCHAR2(150). attribute13 VARCHAR2(150). attribute17 VARCHAR2(150). attribute10 VARCHAR2(150). attribute7 VARCHAR2(150). attribute15 VARCHAR2(150). attribute1 VARCHAR2(150). application_id NUMBER. attribute8 VARCHAR2(150). attribute12 VARCHAR2(150). attribute2 VARCHAR2(150). attribute19 VARCHAR2(150).

V2 Page 84 . attribute17 VARCHAR2(150). attribute16 VARCHAR2(150). attribute23 VARCHAR2(150). decision_maker_flag VARCHAR2(1). attribute9 VARCHAR2(150). attribute21 VARCHAR2(150).contact_number VARCHAR2(30). attribute5 VARCHAR2(150). attribute4 VARCHAR2(150). attribute18 VARCHAR2(150). attribute8 VARCHAR2(150). title VARCHAR2(30). attribute12 VARCHAR2(150). attribute22 VARCHAR2(150). job_title VARCHAR2(100). attribute11 VARCHAR2(150). attribute10 VARCHAR2(150). application_id NUMBER.relationship_rec_ type:=HZ_RELATIONSHIP_V2PUB. attribute2 VARCHAR2(150). attribute24 VARCHAR2(150). attribute1 VARCHAR2(150). attribute13 VARCHAR2(150). orig_system_reference VARCHAR2(240). party_rel_rec HZ_RELATIONSHIP_V2PUB. attribute15 VARCHAR2(150). created_by_module VARCHAR2(150). attribute20 VARCHAR2(150). attribute6 VARCHAR2(150). attribute7 VARCHAR2(150). department_code VARCHAR2(30). party_site_id NUMBER. department VARCHAR2(60). attribute14 VARCHAR2(150).G_MISS_ REL_REC ) PL/SQL Record Structure for Location TYPE location_rec_type IS RECORD( Documentation on using TCA APIs . rank VARCHAR2(30). attribute3 VARCHAR2(150). attribute19 VARCHAR2(150). reference_use_flag VARCHAR2(1). attribute_category VARCHAR2(30). job_title_code VARCHAR2(30).

postal_plus4_code VARCHAR2(10). address1 VARCHAR2(240). attribute4 VARCHAR2(150). content_source_type VARCHAR2(30):= HZ_PARTY_V2PUB. attribute3 VARCHAR2(150). province VARCHAR2(60). position VARCHAR2(50). fa_location_id NUMBER.SDO_GEOMETRY:= hz_geometry_ default. address_effective_date DATE. floor VARCHAR2(50). attribute2 VARCHAR2(150). house_number VARCHAR2(50). city VARCHAR2(60). sales_tax_geocode VARCHAR2(30). address3 VARCHAR2(240).location_id NUMBER. state VARCHAR2(60). Documentation on using TCA APIs . orig_system_reference VARCHAR2(240). address_style VARCHAR2(30).V2 Page 85 . address4 VARCHAR2(240). address_key VARCHAR2(500). description VARCHAR2(2000). suite VARCHAR2(50). loc_hierarchy_id NUMBER. attribute_category VARCHAR2(30). street VARCHAR2(50). country VARCHAR2(60). language VARCHAR2(4). short_description VARCHAR2(240). sales_tax_inside_city_limits VARCHAR2(30). postal_code VARCHAR2(60). location_directions VARCHAR2(640). address_expiration_date DATE. po_box_number VARCHAR2(50). geometry MDSYS. clli_code VARCHAR2(60).G_MISS_ CONTENT_SOURCE_TYPE. attribute5 VARCHAR2(150). street_suffix VARCHAR2(50). attribute1 VARCHAR2(150). address2 VARCHAR2(240). address_lines_phonetic VARCHAR2(560). county VARCHAR2(60). street_number VARCHAR2(50). validated_flag VARCHAR2(1).

attribute20 VARCHAR2(150). attribute18 VARCHAR2(150). attribute3 VARCHAR2(150). attribute10 VARCHAR2(150). attribute17 VARCHAR2(150). attribute1 VARCHAR2(150). attribute16 VARCHAR2(150). attribute2 VARCHAR2(150). attribute5 VARCHAR2(150). attribute9 VARCHAR2(150). status VARCHAR2(1). party_site_name VARCHAR2(240). attribute19 VARCHAR2(150). attribute11 VARCHAR2(150). attribute6 VARCHAR2(150). identifying_address_flag VARCHAR2(1). attribute12 VARCHAR2(150). attribute9 VARCHAR2(150). attribute_category VARCHAR2(30). attribute8 VARCHAR2(150). attribute12 VARCHAR2(150). attribute14 VARCHAR2(150). attribute10 VARCHAR2(150). Documentation on using TCA APIs . party_id NUMBER. application_id NUMBER ) PL/SQL Record Structure for Party Site TYPE party_site_rec_type IS RECORD( party_site_id NUMBER. orig_system_reference VARCHAR2(240).attribute6 VARCHAR2(150).V2 Page 86 . party_site_number VARCHAR2(30). attribute15 VARCHAR2(150). created_by_module VARCHAR2(150). mailstop VARCHAR2(60). attribute8 VARCHAR2(150). timezone_id NUMBER. attribute4 VARCHAR2(150). attribute7 VARCHAR2(150). attribute7 VARCHAR2(150). attribute11 VARCHAR2(150). attribute13 VARCHAR2(150). location_id NUMBER.

primary_per_type VARCHAR2(1). site_use_type VARCHAR2(30). status VARCHAR2(1). attribute2 VARCHAR2(150). created_by_module VARCHAR2(150). attribute15 VARCHAR2(150). attribute4 VARCHAR2(150).G_ MISS_CONTENT_SOURCE_TYPE. contact_point_type VARCHAR2(30). comments VARCHAR2(240). attribute19 VARCHAR2(150). attribute5 VARCHAR2(150). application_id NUMBER ) PL/SQL Record Structure for Contact Point TYPE contact_point_rec_type IS RECORD ( contact_point_id NUMBER. attribute3 VARCHAR2(150). party_site_id NUMBER. addressee VARCHAR2(150). attribute18 VARCHAR2(150). attribute14 VARCHAR2(150). attribute_category VARCHAR2(30).attribute13 VARCHAR2(150). owner_table_id NUMBER. Documentation on using TCA APIs . attribute17 VARCHAR2(150). orig_system_reference VARCHAR2(240). attribute20 VARCHAR2(150). attribute16 VARCHAR2(150). created_by_module VARCHAR2(150). status VARCHAR2(30). content_source_type VARCHAR2(30):= HZ_PARTY_V2PUB. attribute6 VARCHAR2(150). language VARCHAR2(4). owner_table_name VARCHAR2(30). application_id NUMBER ) PL/SQL Record Structure for Party Site Use TYPE party_site_use_rec_type IS RECORD ( party_site_use_id NUMBER. attribute1 VARCHAR2(150). primary_flag VARCHAR2(1).V2 Page 87 .

phone_country_code VARCHAR2(10). phone_extension VARCHAR2(20). created_by_module VARCHAR2(150). timezone_id NUMBER. contact_point_purpose VARCHAR2(30). attribute12 VARCHAR2(150). attribute13 VARCHAR2(150).attribute7 VARCHAR2(150). create_party_flag VARCHAR2(1). attribute14 VARCHAR2(150). attribute20 VARCHAR2(150). Documentation on using TCA APIs . attribute17 VARCHAR2(150). application_id NUMBER ) PL/SQL Record Structure for Phone TYPE phone_rec_type IS RECORD ( phone_calling_calendar VARCHAR2(30). relationship_type VARCHAR2(30). primary_by_purpose VARCHAR2(1). backward_rel_code VARCHAR2(30).V2 Page 88 . phone_line_type VARCHAR2(30). hierarchical_flag VARCHAR2(1). attribute9 VARCHAR2(150). attribute8 VARCHAR2(150). allow_relate_to_self_flag VARCHAR2(1). attribute11 VARCHAR2(150). raw_phone_number VARCHAR2(60) ) PL/SQL Record Structure for Create Relationship Type API TYPE relationship_type_rec_type IS RECORD( relationship_type_id NUMBER. attribute15 VARCHAR2(150). last_contact_dt_time DATE. forward_rel_code VARCHAR2(30). attribute16 VARCHAR2(150). attribute10 VARCHAR2(150). phone_number VARCHAR2(40). attribute19 VARCHAR2(150). direction_code VARCHAR2(30). attribute18 VARCHAR2(150). phone_area_code VARCHAR2(10).

object_id NUMBER. attribute19 VARCHAR2(150).allow_circular_relationships VARCHAR2(1). attribute6 VARCHAR2(150). subject_table_name VARCHAR2(30). attribute7 VARCHAR2(150). attribute16 VARCHAR2(150). subject_id NUMBER. application_id NUMBER ) PL/SQL Record Structure for Create Relationship API TYPE relationship_rec_type IS RECORD( relationship_id NUMBER. attribute13 VARCHAR2(150). attribute1 VARCHAR2(150). attribute18 VARCHAR2(150). object_type VARCHAR2(30). relationship_type VARCHAR2(30).V2 Page 89 . attribute10 VARCHAR2(150). attribute12 VARCHAR2(150). subject_type VARCHAR2(30). Documentation on using TCA APIs . attribute_category VARCHAR2(30). attribute9 VARCHAR2(150). status VARCHAR2(1). subject_type VARCHAR2(30). attribute2 VARCHAR2(150). attribute4 VARCHAR2(150). attribute15 VARCHAR2(150). attribute8 VARCHAR2(150). attribute17 VARCHAR2(150). attribute5 VARCHAR2(150). status VARCHAR2(1). end_date DATE. attribute3 VARCHAR2(150). comments VARCHAR2(240). content_source_type VARCHAR2(30). object_type VARCHAR2(30). object_table_name VARCHAR2(30). relationship_code VARCHAR2(30). start_date DATE. attribute11 VARCHAR2(150). created_by_module VARCHAR2(150). attribute14 VARCHAR2(150).

additional_information3 VARCHAR2(150). additional_information20 VARCHAR2(150). additional_information8 VARCHAR2(150). additional_information11 VARCHAR2(150). additional_information21 VARCHAR2(150). additional_information14 VARCHAR2(150). additional_information2 VARCHAR2(150). allow_ multi _ parent _ flag VARCHAR2 ( 1) . additional_information7 VARCHAR2(150). additional_information10 VARCHAR2(150). additional_information18 VARCHAR2(150). additional_information23 VARCHAR2(150). additional_information30 VARCHAR2(150). additional_information13 VARCHAR2(150). application_id NUMBER. additional_information22 VARCHAR2(150). created_by_module VARCHAR2(150). additional_information27 VARCHAR2(150). ) PL/SQL Record Structure for Create Class Category API TYPE class_category_rec_type IS RECORD ( class_category VARCHAR2(30). additional_information12 VARCHAR2(150). party_rec HZ_PARTY_V2PUB. additional_information24 VARCHAR2(150). additional_information6 VARCHAR2(150). additional_information15 VARCHAR2(150). G_MI SS_PARTY_REC additional_information1 VARCHAR2(150). additional_information4 VARCHAR2(150). allow_ multi _assign_ flag VARCHAR2 ( 1) . Documentation on using TCA APIs .PARTY_REC_TYPE:= HZ_ PARTY_V2PUB. additional_information26 VARCHAR2(150).attribute20 VARCHAR2(150).V2 Page 90 . additional_information17 VARCHAR2(150). additional_information16 VARCHAR2(150). additional_information28 VARCHAR2(150). additional_information29 VARCHAR2(150). additional_information19 VARCHAR2(150). additional_information5 VARCHAR2(150). additional_information9 VARCHAR2(150). additional_information25 VARCHAR2(150). created_by_module VARCHAR2(150). allow_leaf_node _ only _ fla g VARCHAR2 ( 1 ) .

start_date_active DATE. attribute3 VARCHAR2(150). attribute14 VARCHAR2(150). attribute8 VARCHAR2(150). attribute9 VARCHAR2(150). end_date_active DATE. content_source_type VARCHAR2(30):= HZ_PARTY_V2PUB. status VARCHAR2(1). attribute_category VARCHAR2(30). attribute17 VARCHAR2(150). attribute1 VARCHAR2(150). attribute10 VARCHAR2(150). class_category VARCHAR2(30). class_code VARCHAR2(30). attribute4 VARCHAR2(150). attribute7 VARCHAR2(150). account_number VARCHAR2(30). attribute6 VARCHAR2(150).application_id NUMBER ) PL/SQL Record Structure for Create Code Assignment API TYPE code_assignment_rec_type IS RECORD ( code_assignment_id NUMBER. attribute16 VARCHAR2(150). created_by_module VARCHAR2(150). owner_table_name VARCHAR2(30). attribute15 VARCHAR2(150). application_id NUMBER ) PL/SQL Record Structure for Customer Account TYPE cust_account_rec_type IS RECORD ( cust_account_id NUMBER.V2 Page 91 . attribute2 VARCHAR2(150). attribute18 VARCHAR2(150). G_MISS_ CONTENT_SOURCE_TYPE. attribute12 VARCHAR2(150). attribute13 VARCHAR2(150). Documentation on using TCA APIs . attribute11 VARCHAR2(150). attribute5 VARCHAR2(150). primary_flag VARCHAR2(1). owner_table_id NUMBER.

global_attribute16 VARCHAR2(150). global_attribute3 VARCHAR2(150). tax_header_level_flag VARCHAR2(1). global_attribute2 VARCHAR2(150). primary_specialist_id NUMBER. fob_point VARCHAR2(30). global_attribute5 VARCHAR2(150). status VARCHAR2(1). account_established_date DATE. global_attribute4 VARCHAR2(150). attribute20 VARCHAR2(150). primary_salesrep_id NUMBER. global_attribute13 VARCHAR2(150). order_type_id NUMBER. global_attribute14 VARCHAR2(150). global_attribute17 VARCHAR2(150). customer_type VARCHAR2(30). freight_term VARCHAR2(30). secondary_specialist_id NUMBER. global_attribute19 VARCHAR2(150). global_attribute9 VARCHAR2(150). global_attribute18 VARCHAR2(150). account_liable_flag VARCHAR2(1). warehouse_id NUMBER. tax_code VARCHAR2(50). global_attribute8 VARCHAR2(150). global_attribute11 VARCHAR2(150). Documentation on using TCA APIs . ship_partial VARCHAR2(1). global_attribute12 VARCHAR2(150). global_attribute7 VARCHAR2(150). customer_class_code VARCHAR2(30). current_balance NUMBER. global_attribute15 VARCHAR2(150). global_attribute1 VARCHAR2(150). ship_via VARCHAR2(25). price_list_id NUMBER. sales_channel_code VARCHAR2(30). global_attribute20 VARCHAR2(150). coterminate_day_month VARCHAR2(6). global_attribute10 VARCHAR2(150). tax_rounding_rule VARCHAR2(30).V2 Page 92 . orig_system_reference VARCHAR2(240). global_attribute6 VARCHAR2(150). global_attribute_category VARCHAR2(30).attribute19 VARCHAR2(150). account_termination_date DATE.

date_type_preference VARCHAR2(20). Documentation on using TCA APIs . account_name VARCHAR2(240). attribute_category VARCHAR2(30). attribute2 VARCHAR2(150). attribute1 VARCHAR2(150).account_activation_date DATE. invoice_quantity_rule VARCHAR2(30). suspension_date DATE.V2 Page 93 . over_shipment_tolerance NUMBER. last_batch_id NUMBER. arrivalsets_include_lines_flag VARCHAR2(1). party_site_id NUMBER. created_by_module VARCHAR2(150). application_id NUMBER ) PL/SQL Record Structure for Customer Account Site TYPE cust_acct_site_rec_type IS RECORD ( cust_acct_site_id NUMBER. department VARCHAR2(30). hold_bill_flag VARCHAR2(1). ship_sets_include_lines_flag VARCHAR2(1). under_return_tolerance NUMBER. comments VARCHAR2(240). cust_account_id NUMBER. dates_positive_tolerance NUMBER. deposit_refund_method VARCHAR2(20). held_bill_expiration_date DATE. status_update_date DATE. selling_party_id NUMBER. notify_flag VARCHAR2(1). dormant_account_flag VARCHAR2(1). attribute3 VARCHAR2(150). under_shipment_tolerance NUMBER. acct_life_cycle_status VARCHAR2(30). sched_date_push_flag VARCHAR2(1). item_cross_ref_pref VARCHAR2(30). over_return_tolerance NUMBER. realtime_rate_flag VARCHAR2(1). source_code VARCHAR2(150). dates_negative_tolerance NUMBER. npa_number VARCHAR2(60). autopay_flag VARCHAR2(1). pricing_event VARCHAR2(30).

global_attribute_category VARCHAR2(30). attribute9 VARCHAR2(150). attribute19 VARCHAR2(150). global_attribute1 VARCHAR2(150). attribute16 VARCHAR2(150). attribute20 VARCHAR2(150). attribute6 VARCHAR2(150). global_attribute11 VARCHAR2(150). global_attribute2 VARCHAR2(150).attribute4 VARCHAR2(150). attribute10 VARCHAR2(150). global_attribute19 VARCHAR2(150). global_attribute14 VARCHAR2(150). attribute7 VARCHAR2(150). attribute8 VARCHAR2(150). attribute18 VARCHAR2(150). global_attribute4 VARCHAR2(150). ece_tp_location_code VARCHAR2(40). attribute11 VARCHAR2(150). global_attribute20 VARCHAR2(150). attribute14 VARCHAR2(150). customer_category_code VARCHAR2(30). language VARCHAR2(4). global_attribute15 VARCHAR2(150). global_attribute12 VARCHAR2(150). global_attribute10 VARCHAR2(150). attribute13 VARCHAR2(150). global_attribute16 VARCHAR2(150). attribute12 VARCHAR2(150). global_attribute18 VARCHAR2(150). global_attribute5 VARCHAR2(150). global_attribute8 VARCHAR2(150). global_attribute6 VARCHAR2(150). attribute5 VARCHAR2(150). attribute17 VARCHAR2(150). key_account_flag VARCHAR2(1). global_attribute3 VARCHAR2(150). global_attribute9 VARCHAR2(150). tp_header_id NUMBER. global_attribute7 VARCHAR2(150). orig_system_reference VARCHAR2(240). Documentation on using TCA APIs . attribute15 VARCHAR2(150). status VARCHAR2(1). global_attribute17 VARCHAR2(150). global_attribute13 VARCHAR2(150). primary_specialist_id NUMBER.V2 Page 94 .

translated_customer_name VARCHAR2(50). attribute4 VARCHAR2(150). tax_reference VARCHAR2(50). territory_id NUMBER. ship_partial VARCHAR2(1). location VARCHAR2(40). warehouse_id NUMBER. gsa_indicator VARCHAR2(1). ship_via VARCHAR2(25). freight_term VARCHAR2(30). price_list_id NUMBER. territory_id NUMBER. status VARCHAR2(1). Documentation on using TCA APIs . primary_flag VARCHAR2(1). territory VARCHAR2(30). created_by_module VARCHAR2(150). bill_to_site_use_id NUMBER. attribute5 VARCHAR2(150). attribute_category VARCHAR2(30).V2 Page 95 . attribute3 VARCHAR2(150). fob_point VARCHAR2(30). attribute2 VARCHAR2(150). sort_priority NUMBER. site_use_code VARCHAR2(30). attribute9 VARCHAR2(150). attribute7 VARCHAR2(150). attribute11 VARCHAR2(150). application_id NUMBER ) PL/SQL Record Structure for Customer Account Site Use TYPE cust_site_use_rec_type IS RECORD ( site_use_id NUMBER. order_type_id NUMBER. orig_system_reference VARCHAR2(240). attribute6 VARCHAR2(150).secondary_specialist_id NUMBER. tax_code VARCHAR2(50). attribute8 VARCHAR2(150). cust_acct_site_id NUMBER. sic_code VARCHAR2(30). attribute10 VARCHAR2(150). payment_term_id NUMBER. attribute1 VARCHAR2(150).

attribute16 VARCHAR2(150). global_attribute13 VARCHAR2(150). under_shipment_tolerance NUMBER. attribute19 VARCHAR2(150). attribute25 VARCHAR2(150). global_attribute10 VARCHAR2(150). attribute20 VARCHAR2(150).V2 Page 96 . attribute13 VARCHAR2(150). attribute24 VARCHAR2(150). global_attribute15 VARCHAR2(150). global_attribute4 VARCHAR2(150). date_type_preference VARCHAR2(20). global_attribute5 VARCHAR2(150). item_cross_ref_pref VARCHAR2(30). global_attribute8 VARCHAR2(150). dates_positive_tolerance NUMBER. global_attribute18 VARCHAR2(150). dates_negative_tolerance NUMBER. global_attribute2 VARCHAR2(150). global_attribute1 VARCHAR2(150). global_attribute9 VARCHAR2(150). global_attribute12 VARCHAR2(150).attribute12 VARCHAR2(150). attribute17 VARCHAR2(150). global_attribute17 VARCHAR2(150). attribute15 VARCHAR2(150). over_shipment_tolerance NUMBER. attribute22 VARCHAR2(150). attribute14 VARCHAR2(150). global_attribute_category VARCHAR2(30). global_attribute11 VARCHAR2(150). global_attribute3 VARCHAR2(150). global_attribute19 VARCHAR2(150). global_attribute6 VARCHAR2(150). attribute18 VARCHAR2(150). global_attribute20 VARCHAR2(150). finchrg_receivables_trx_id NUMBER. attribute21 VARCHAR2(150). global_attribute14 VARCHAR2(150). primary_salesrep_id NUMBER. Documentation on using TCA APIs . attribute23 VARCHAR2(150). global_attribute7 VARCHAR2(150). global_attribute16 VARCHAR2(150). tax_rounding_rule VARCHAR2(30). tax_header_level_flag VARCHAR2(1). demand_class_code VARCHAR2(30).

interest_charges VARCHAR2(1). gl_id_unpaid_rec NUMBER. arrivalsets_include_lines_flag VARCHAR2(1). send_statements VARCHAR2(1). application_id NUMBER ) PL/SQL Record Structure for Create Customer Profile API TYPE customer_profile_rec_type IS RECORD ( cust_account_profile_id NUMBER. ship_sets_include_lines_flag VARCHAR2(1). credit_hold VARCHAR2(1). gl_id_unearned NUMBER. gl_id_clearing NUMBER. under_return_tolerance NUMBER. gl_id_unbilled NUMBER.over_return_tolerance NUMBER. collector_id NUMBER. tolerance NUMBER. profile_class_id NUMBER. status VARCHAR2(1). credit_checking VARCHAR2(1). override_terms VARCHAR2(1).V2 Page 97 . credit_analyst_id NUMBER. gl_id_rev NUMBER. created_by_module VARCHAR2(150). gl_id_rec NUMBER. Documentation on using TCA APIs . risk_code VARCHAR2(30). tax_classification VARCHAR2(30). gl_id_tax NUMBER. gl_id_remittance NUMBER. invoice_quantity_rule VARCHAR2(30). dunning_letters VARCHAR2(1). cust_account_id NUMBER. credit_balance_statements VARCHAR2(1). standard_terms NUMBER. site_use_id NUMBER. pricing_event VARCHAR2(30). gl_id_factor NUMBER. credit_rating VARCHAR2(30). gl_id_freight NUMBER. next_credit_review_ DATE. sched_date_push_flag VARCHAR2(1). discount_terms VARCHAR2(1).

jgzz_attribute3 VARCHAR2(150). interest_period_days NUMBER. attribute6 VARCHAR2(150). jgzz_attribute9 VARCHAR2(150). auto_rec_incl_disputed_flag VARCHAR2(1). account_status VARCHAR2(30). jgzz_attribute4 VARCHAR2(150). jgzz_attribute5 VARCHAR2(150). attribute_category VARCHAR2(30). attribute12 VARCHAR2(150). attribute14 VARCHAR2(150). jgzz_attribute15 VARCHAR2(150). grouping_rule_id NUMBER. jgzz_attribute10 VARCHAR2(150). clearing_days NUMBER. attribute8 VARCHAR2(150). attribute9 VARCHAR2(150). global_attribute1 VARCHAR2(150). attribute10 VARCHAR2(150). jgzz_attribute7 VARCHAR2(150). attribute3 VARCHAR2(150). attribute4 VARCHAR2(150). attribute11 VARCHAR2(150). jgzz_attribute2 VARCHAR2(150). jgzz_attribute_category VARCHAR2(30). percent_collectable NUMBER. jgzz_attribute1 VARCHAR2(150). attribute1 VARCHAR2(150). jgzz_attribute11 VARCHAR2(150). discount_grace_days NUMBER. statement_cycle_id NUMBER. payment_grace_days NUMBER. jgzz_attribute6 VARCHAR2(150). tax_printing_option VARCHAR2(30). jgzz_attribute12 VARCHAR2(150). attribute13 VARCHAR2(150). Documentation on using TCA APIs . charge_on_finance_charge_flag VARCHAR2(1). attribute15 VARCHAR2(150). attribute7 VARCHAR2(150). jgzz_attribute8 VARCHAR2(150). attribute2 VARCHAR2(150). jgzz_attribute14 VARCHAR2(150). jgzz_attribute13 VARCHAR2(150).dunning_letter_set_id NUMBER. attribute5 VARCHAR2(150). autocash_hierarchy_id NUMBER.V2 Page 98 .

global_attribute16 VARCHAR2(150). global_attribute11 VARCHAR2(150). global_attribute12 VARCHAR2(150). global_attribute20 VARCHAR2(150). global_attribute_category VARCHAR2(30). global_attribute7 VARCHAR2(150). global_attribute14 VARCHAR2(150). global_attribute15 VARCHAR2(150). lockbox_matchi ng_opt i on VARCHAR2( 30) . global_attribute10 VARCHAR2(150). cons_inv_type VARCHAR2(30). global_attribute19 VARCHAR2(150). global_attribute8 VARCHAR2(150). autocash_hierarchy_id_for_adr NUMBER. created_by_module VARCHAR2(150).global_attribute2 VARCHAR2(150). application_id NUMBER ) Documentation on using TCA APIs . global_attribute4 VARCHAR2(150). global_attribute18 VARCHAR2(150). cons_inv_flag VARCHAR2(1). global_attribute13 VARCHAR2(150). global_attribute17 VARCHAR2(150). global_attribute3 VARCHAR2(150). global_attribute5 VARCHAR2(150). global_attribute6 VARCHAR2(150). global_attribute9 VARCHAR2(150).V2 Page 99 .

In the TCA APIs all error messages are put on the message stack during execution and can be retrieved by the caller. 294015 HZ_API_CLA_CAT_WHERE 294220 HZ_API_COLUMN_SHOULD_BE_NULL Documentation on using TCA APIs . 294224 HZ_API_BILL_TO_SITE_USE_F The site use referenced by this bill_to_site_use_id must be active bill-to 294225 HZ_API_BILL_TO_SITE_USE_S User can only assign bill_to_site_use_id when the current account site use purpose is ship-to. The appropriate messages must be raised at the right points in the processing to accurately describe the error that has occurred. Most of the time The &COLUMN column in the &TABLE table must be null.V2 Page 100 . Please change the value of the column to null. 294227 HZ_API_ACCT_SITEUSE_MISMATCH 294228 HZ_API_ACCT_SITE_MISSMATCH The site must belong to the customer account. Number Code Message 96273 HZ_API_ACCOUNT_NUMBER_AUTO_ON User cannot pass the account number because account number auto-generation is enabled. The &OWNER_TABLE_ID record ID from the &OWNER_TABLE owner table cannot be validated against the database.MESSAGES FOR THE TCA API Messages play an important role in the effectiveness of API calls. The site use must belong to the customer account.

294219 HZ_API_INACTIVE_PROFILE_CLASS The customer profile class &NAME is inactive. Please enter a different preference or update the existing preference (&COLUMN=&ID).V2 Page 101 . The following error occurred in procedure &PROCEDURE: 96279 HZ_API_HOOK_ERROR 294115 HZ_API_INACTIVE_NOT_PRIMARY An inactive contact point cannot be the primary contact point. 294067 HZ_API_INVALID_COMBINATION 96249 HZ_API_INVALID_FK 96244 HZ_API_INVALID_LOOKUP Value for &COLUMN must be a value defined in lookup type &LOOKUP_TYPE. Backward relationship code must be the same for all records of a specified combination of forward relationship code Invalid value for &FK. 294237 HZ_API_DUPLICATE_RECORD The time range of this preference overlaps with the existing preference &COLUMN=&ID in the &TABLE table. Please select another profile class for the customer profile. 96242 HZ_API_DUPLICATE_COLUMN Value for &COLUMN must be unique. Documentation on using TCA APIs . Please enter &COLUMN value from &TABLE.96274 HZ_API_DATE_GREATER &DATE2 cannot be earlier than &DATE1.

Documentation on using TCA APIs . 96243 HZ_API_MISSING_COLUMN 294009 HZ_API_MULTI_PARENT_FORBID The &CLASS_CODE3 class code cannot be a child of the &CLASS_CODE2 class code because the &CLASS_CATEGORY category does not allow multiple parents during a specific date range. No &RECORD was found for ID &VALUE.V2 Page 102 . 96247 HZ_API_NO_RECORD 294221 HZ_API_OBSOLETE_COLUMN The &COLUMN column is obsolete. 294223 HZ_API_NEGATIVE_PROFILE_CLASS 96246 HZ_API_NONUPDATEABLE_COLUMN 96277 HZ_API_NONUPDATEABLE_TO_NULL User cannot update column &COLUMN to null. Please use a different profile class. Users are not allowed to pass a value to this column. Please enter a positive number for the profile class ID. 294218 HZ_API_NO_DEFAULT_PROF_CLASS Cannot find the default customer profile class (profile class ID = 0). User cannot update column &COLUMN.294005 HZ_API_LEAF_ONLY_NOT_ALLOWED One or more associations use the parent codes of &CLASS_CATEGORY class category. Column &COLUMN must have a value. The &CLASS_CODE2 class code is a child of the &CLASS_CODE1 class code in the & The profile class ID must be positive.

294249 HZ_API_ONE_NATIVE_PER_PARTY Each party can have only one native language. Please change any existing native language to non-native before making this the native language The following SQL error occurred: 96278 HZ_API_OTHERS_EXCEP 96271 HZ_API_PARTY_NUMBER_AUTO_ON User cannot pass the party number because the profile option HZ:Generate Party Number is either null or is set to Yes. This value for the column sic_code_type is allowed only if the column content_source_type has the value USER_ENTERED. Please change any existing primary &ENTITY1 to nonprimary before making this record primary The &ENTITY ID of the profile amount must be the same as the &ENTITY ID of the customer profile. 294222 HZ_API_PARTY_OBJECT_MISMATCH 96272 HZ_API_PARTY_SITE_NUM_AUTO_ON 294250 HZ_API_PRIMARY_PER_ENTITY 294229 HZ_API_PROF_AMT_IDS_MISMATCH 96245 HZ_API_RECORD_CHANGED 96821 HZ_API_SIC_CODE_TYPE_OTHER Documentation on using TCA APIs .V2 Page 103 . the party ID of the party site must be the same as the object ID of the relationship. Users cannot pass the party site number because the profile option HZ:Generate Party Site Number is either null or is set to Yes. Please change either the party site or the object ID. Each &ENTITY2 can have only one primary &ENTITY1. This record in table &TABLE cannot be locked as it has been updated by another user. For a contact.

The &CLASS_CATEGORY category has parent class codes &CLASS_CODE1 from &START1 to &END The size of the &COLUMN column cannot be more than &SIZE characters. Users cannot have any records with more than one class code from the &CLASS_CATEGORY category during a specific date range. Documentation on using TCA APIs . Please pass a value of &SIZE or fewer characters.96820 HZ_API_SIC_CODE_TYPE_REQUIRED Please set both the sic_code and sic_code_type columns if one of these columns already has a value. End date cannot be earlier than the start date.V2 Page 104 . a primary contact is already defined for this type of role. 96965 HZ_API_UNIQUE_PRIMARY_ORG_CONT For this party. The &OWNER_TABLE_ID ID from the &OWNER_TABLE table from the &CONTENT_SOURCE_TYPE source has class codes &CLASS_CODE1 from &START1 to The &CLASS_CATEGORY category cannot update because the &CLASS_CODE3 class code in the &CLASS_CATEGORY category cannot have multiple parents during a specific date range. 294007 HZ_API_SIN_ASS_NOT_ALLOWED 294006 HZ_API_SIN_PAR_NOT_ALLOWED 294251 HZ_API_SIZE_ERROR 96248 HZ_API_START_DATE_GREATER 96250 HZ_API_SUBJECT_OBJECT_IDS Subject ID and object ID cannot refer to the same party ID.

User have passed a Raw Phone Number without a Country Code or the Country Code that does not exist.96291 HZ_API_UNIQUE_PRIMARY_ROLE A Primary role is already defined for this org contact. 96815 HZ_COUNTRY_CODE_NOT_DEFINED 294239 HZ_CP_REC_NOT_FOUND 294230 HZ_CUST_ACCT_ROLE_PRIMARY 294233 HZ_INVALID_CONTACT_LEVEL_TABLE Documentation on using TCA APIs . Please assign a valid contact level table to the &CONTACT_TYPE type of contact. Updates to this field require that an update be made to a corresponding record in the HZ_CONTACT_PREFERENCES table. User cannot make this account role primary. The contact level table for the &CONTACT_TYPE type of contact can not be &CONTACT_LEVEL_TABLE. This field cannot be updated because no record in the HZ_CONTACT_PREFERENCES table corresponds to record (&PRIMARY_KEY= &ID) in the &SOURC A primary account role already exists for this &ENTITY. 96292 HZ_API_UNIQUE_ROLE_TYPE A role of this type is already defined for this org contact. 294014 HZ_API_USE_TAB_CAT There is no association between &OWNER_TABLE owner table and &CLASS_CATEGORY class category in HZ_CLASS_CATEGORY_USES.V2 Page 105 . 96695 HZ_API_UNIQUE_SITE_USE_TYPE A site use of this type is already defined for this party site. Please contact the applications administrator.

then the direction code must be either P (Parent) or C(Child). 294065 HZ_INVALID_DIRECTION_CODE If the forward and backward relationship codes are the same. User cannot pass multiple preference values. Either a Raw Phone Number or the Area Code and Phone Number should be passed. User must pass at least one preference value. then the direction code must be N (Nondirectional). If the forward relationship code and the backward relationship code are different.294232 HZ_INVALID_CONTACT_TYPE The &INCORRECT_CONTACT_TYPE contact type can not be assigned to the contact point of type &CONTACT_POINT_TYPE. 294068 HZ_INVALID_DIRECTION_CODE1 294069 HZ_INVALID_DIRECTION_CODE2 96816 HZ_INVALID_PHONE_PARAMETER 294112 HZ_MULTIPLE_PREFERENCES 294238 HZ_NONUPDATEABLE_PREF_DATE 294113 HZ_NO_PREFERENCE 294066 HZ_NO_REL_TYPE Documentation on using TCA APIs . the direction code must be N which indicates a nondirectional relationship. If the forward relationship code and the backward relationship code are the same.V2 Page 106 . Please pass one preference value from one of the VALUE_VARCHAR2 This relationship type is not valid for the given subject type and object type. Please pass only one preference value from one of the VALUE_VARCHAR2 Dates cannot be updated to a time earlier than the current date. Please enter a date after &SYS_DATE.

User cannot create a relationship for a time period that overlaps the time period of an existing relationship with the same subject id User cannot create multiple preference values for a single-value preference code. Please check the Phone Format setup.V2 Page 107 . No Phone Format could be found. Documentation on using TCA APIs . This option is not currently available.96814 HZ_PHONE_FORMAT_NOT_DEFINED User have passed a Raw Phone Number and the Country Code. 294072 HZ_RELATIONSHIP_DATE_OVERLAP 294114 HZ_SINGLE_VALUE_PREFERENCE 294070 HZ_VALUES_NOT_SUPPORTED User cannot set the &FIELD to &VALUE.

Worldwide Inquiries: Phone: +1.506. CA 94065 U. All other product and service names mentioned may be trademarks of their respective owners.S.V2 Page 108 .7200 www.oracle.650.506.7000 Fax: +1. Various product and service names referenced herein may be trademarks of Oracle Corporation. Documentation on using TCA APIs .A.650.com Oracle is a registered trademark of Oracle Corporation.DOCUMENTATION ON USING TCA APIs – V2 May 2002 Author: Viswanathan Rajagopalan Contributing Authors: Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores. Copyright © 2002 Oracle Corporation All rights reserved.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->