You are on page 1of 98

1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Safe Harbor Statement

The following is intended to outline our general product


direction. It is intended for information purposes only, and
may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing decision.
The development, release, and timing of any features or
functionality described for Oracle’s products remains at the
sole discretion of Oracle.

2 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Oracle Advisor Webcast
Using Trading Community Architecture (TCA)
Application Programming Interfaces (APIs)

Tasneem Furniturewalla
Principal Support Engineer
TCA API Webcast Resource Links

To access TCA API recorded webcast, use:


https://oracleaw.webex.com/oracleaw/lsr.php?AT=pb&SP=EC&r
ID=77285407&rKey=d3e2a1065cdc18ef

To ask questions on the topic of TCA APIs, use:


https://communities.oracle.com/portal/server.pt/community/view
_discussion_topic/216?threadid=698501

4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Objectives
Following this session, you will understand:
 The Trading Community Architecture
(TCA) Customer Data Model
 Customer Account Creation Flow
 How To Use TCA Application
Programming Interfaces (APIs)
 The Customers User Interface

5 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Agenda
 What is an Application Programming Interface (API)?
 Overview of Trading Community Architecture (TCA) PL/SQL APIs
 Advantages
 API Components
 API Features
 Customer Entities
 API Coding Steps & Sample Code
 Customer Account Creation Flow with Steps & Demo

6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


What Is An Application Programming Interface?
 An Application Programming Interface (API) is a PL/SQL packaged
procedure which can be used as an alternative to traditional application
online forms.

 There are three categories of APIs:


 PL/SQL Public API
 JAVA Public API
 Forms API

 Today we will focus on PL/SQL V2 Public API for TCA.

7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Overview Of Trading Community Architecture
PL/SQL APIs
 Contain many procedures to insert and modify application data
 Must be called, or executed from within PL/SQL modules
 Version 2 Public API feature is available from HZ Patchset E
 The Trading Community Architecture (TCA) data model is the
foundation for the TCA APIs
 Refer R11i / R12 Trading Community Architecture Technical
Implementation Guide

8 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Advantages Of TCA APIs
 Flexible, easy to understand and modular
 Ensures data integrity in Oracle Application tables
 Allows update of columns not available through the Customer
Interface
 Allows update of columns to NULL, also not possible through
Customer Interface
 Extensive debugging capability for troubleshooting
 Extensive error handling capability
 Robust validation

9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


API Components
 API Category
 Create Customer Account API
 Update Customer Account API

 PL/SQL Package – HZ_CUST_ACCOUNT_V2PUB

 PL/SQL Procedure
 CREATE_CUST_ACCOUNT
 UPDATE_CUST_ACCOUNT

 PL/SQL Record Structure – CUST_ACCOUNT_REC_TYPE

 Attributes – Data Type, Validation and Defaults

10 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


API Components
PROCEDURE create_cust_account (
p_init_msg_list IN VARCHAR2:= FND_API.G_FALSE,
p_cust_account_rec IN CUST_ACCOUNT_REC_TYPE,
p_person_rec IN HZ_PARTY_V2PUB.PERSON_REC_TYPE,
p_customer_profile_rec IN
HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE,
p_create_profile_amt IN VARCHAR2:= FND_API.G_TRUE,
x_cust_account_id OUT NUMBER,
x_account_number OUT VARCHAR2,
x_party_id OUT NUMBER,
x_party_number OUT VARCHAR2,
x_profile_id OUT NUMBER,
x_return_status OUT VARCHAR2,
x_msg_count OUT NUMBER,
x_msg_data OUT VARCHAR2 )

11 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


API Features
 Exception handling and results messages
 Overall status – success, failure or unexpected error
 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 – example, as input to the next API
 Validations
 Locking Mechanism
 OBJECT_VERSION_NUMBER mandatory attribute
 Set to 1 when record is created
 Incremented by 1 when record is updated

12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


API Features
 Standard Parameters
 IN or IN/OUT Parameters
p_object_version_number IN/OUT NUMBER Required
p_init_msg_list IN VARCHAR2 Optional

 OUT Parameters
x_return_status OUT VARCHAR2
FND_API.G_RET_STS_SUCCESS - Success
FND_API.G_RET_STS_ERROR – Validation error
FND_API.G_RET_STS_UNEXP_ERROR - Unexpected error
x_msg_count OUT NUMBER
x_msg_data OUT VARCHAR2

13 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


API Features
 Nested Record Types
 For example, Create_Person API uses the person_rec_type record type.
The person_rec_type has party_rec as one of its elements, which itself is
of party_rec_type record type.
 Primary Key Generation
 The Create APIs handle both sequence-generated and manually-passed
primary keys
 Missing Attributes
 Create APIs – missing attributes are defaulted as NULL
 Update APIs – missing attributes retain the existing database value

14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


API Features
 Null Attributes
To set an attribute to NULL it must be set to the following constant
FND_API.G_MISS_NUM for NUMBER type
FND_API.G_MISS_CHAR for VARCHAR2 type
FND_API.G_MISS_DATE for DATE type

 Debug Messages (PL/SQL API)


User can turn on debug messages using profile options
 HZ: Turn On File Debug
 HZ: API Debug File Name
 HZ: API Debug File Directory

15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Entities
Party Layer APIs
Entity API Tables
Party – HZ_PARTIES
HZ_PARTY_V2PUB.create_organization
Organization HZ_ORGANIZATION_PROFILES
HZ_PARTIES
Party - Person HZ_PARTY_V2PUB.create_person
HZ_PERSON_PROFILES
HZ_LOCATIONS
Location HZ_LOCATION_V2PUB.create_location
HZ_LOCATIONS_PROFILES
Party Site HZ_PARTY_SITE_V2PUB.create_party_site HZ_PARTY_SITES
Party Site Use HZ_PARTY_SITE_V2PUB.create_party_site_use HZ_PARTY_SITE_USES
HZ_ORG_CONTACTS
Party Contact HZ_RELATIONSHIPS (Subject:Contact
(Organization HZ_PARTY_CONTACT_V2PUB.create_org_contact person Object:Organization/Person)
Contact) HZ_PARTIES
(party_type=PARTY_RELATIONSHIP)

16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Entities
Party Layer APIs

Entity API Tables


Contact Role HZ_PARTY_CONTACT_V2PUB.create_org_contact_role HZ_ORG_CONTACT_ROLES
HZ_CONTACT_POINT_V2PUB.create_contact_point
HZ_CONTACT_POINT_V2PUB.create_phone_contact_point HZ_CONTACT_POINTS
HZ_CONTACT_POINT_V2PUB.create_email_contact_point Owner_table_name=HZ_PARTIES and
Contact owner_table_id=party_id
HZ_CONTACT_POINT_V2PUB.create_web_contact_point
Point Or
HZ_CONTACT_POINT_V2PUB.create_telex_contact_point
Owner_table_name=HZ_PARTY_SITE
HZ_CONTACT_POINT_V2PUB.create_edi_contact_point S and owner_table_id=party_site_id
HZ_CONTACT_POINT_V2PUB.create_eft_contact_point

17 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Entities
Account Layer APIs

Entity API Tables


HZ_CUST_ACCOUNTS
HZ_PARTIES
Customer Account HZ_CUST_ACCOUNT_V2PUB.create_cust_account
HZ_CUSTOMER_PROFILES
HZ_CUST_PROFILE_AMTS

Account Site HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_acct_site HZ_CUST_ACCT_SITES_ALL

HZ_CUST_SITE_USES_ALL
Account Site Use HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use HZ_CUSTOMER_PROFILES
HZ_CUST_PROFILE_AMTS

Account
HZ_CUST_ACCOUNT_V2PUB. create_cust_acct_relate HZ_CUST_ACCT_RELATE_ALL
Relationship

18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Entities
Account Layer APIs

Entity API Tables

Account / Account Site HZ_CUSTOMER_PROFILES


HZ_CUSTOMER_PROFILE_V2PUB.create_customer_profile
Use Profile HZ_CUST_PROFILE_AMTS

Account / Account Site


HZ_CUSTOMER_PROFILE_V2PUB.create_cust_profile_amt HZ_CUST_PROFILE_AMTS
Use Profile Amount
Account / Account Site HZ_CUST_ACCOUNT_ROLE_V2PUB.create_cust_account_
HZ_CUST_ACCOUNT_ROLES
Role (Contact) role
Account / Account Site HZ_CUST_ACCOUNT_ROLE_V2PUB.create_role_responsi
HZ_ROLE_RESPONSIBILITY
Role Responsibility bility

19 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


API Coding Steps
 Set application context
 fnd_global.apps_initialize (
user_id in number,
resp_id in number,
resp_appl_id in number,
security_group_id in number default 0);

 11i : fnd_client_info.set_org_context(&org_id);
 R12: MO_GLOBAL.set_policy_context('S', &org_id);

20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


API Coding Steps

 Set Serveroutput on to display output values in SQLPLUS

 Determine the API to use


 PL/SQL package, procedure, PL/SQL record structure

 Declare the IN and OUT variables for the parameters of the


procedure

21 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


API Coding Steps
 Assign values to the variables and call the procedure
 Mandatory attributes and validations
 For update APIs, object_version_number of the record to be updated

 Display result status and error messages if any

 Display output variables

22 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Sample Code: Create Person API
DECLARE
p_init_msg_list VARCHAR2(1) := FND_API.G_TRUE;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
API Record x_msg_data VARCHAR2(2000);
Standard IN / OUT variables
p_person_rec HZ_PARTY_V2PUB.PERSON_REC_TYPE;
Type x_party_id NUMBER;
variable x_party_number VARCHAR2(2000); API output parameter variables
x_profile_id NUMBER;
BEGIN
p_person_rec.person_first_name := 'Stella';
p_person_rec.person_last_name := 'Sia';
Assign values to API input
p_person_rec.created_by_module := 'TCA_V2_API'; parameters (record type
HZ_PARTY_V2PUB.create_person (
p_init_msg_list, variable)
p_person_rec,
x_party_id,
x_party_number,
x_profile_id, Call the API
x_return_status,
x_msg_count,
x_msg_data);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_data);
IF x_msg_count > 1 THEN
FOR I IN 1..x_msg_count LOOP Result Status and Error
dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.
Get(p_encoded => FND_API.G_FALSE ), 1, 255));
handling
END LOOP;
END IF;
dbms_output.put_line('x_party_id = '|| x_party_id);
dbms_output.put_line('x_party_number = '|| x_party_number); Display API output values
dbms_output.put_line('x_profile_id = '|| x_profile_id);
EXCEPTION
when others then dbms_output.put_line(sqlerrm(sqlcode));
END;

23 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Sample Code: Output and Data
HZ_PARTY_V2PUB.create_person

Error Status:
x_return_status: E
x_msg_count: 2
x_msg_data:
1. Both the first name and last name cannot be null for a person record.
Please enter the first name, last name, or both.
2. Value for person_pre_name_adjunct must be a value defined in lookup
type CONTACT_TITLE.

Success Status:
x_return_status: S
x_msg_count: 0
x_msg_data:
x_party_id = 490974
x_party_number = 55486
x_profile_id = 436558

24 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Sample Code: Output and Data
HZ_PARTY_V2PUB.create_person

Query Data in the tables:

select party_id, party_number, party_type, party_name


from hz_parties
where party_id = 490974;

PARTY_ID PARTY_NUMBER PARTY_TYPE PARTY_NAME


---------- ------------------ ---------- --------------------
490974 55486 PERSON Stella Sia

Verify Result on Screen:

25 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Sample Code: Query Oracle Customers Online

26 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Demo
TCA APIs for Customer
Account Data

27 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Flow
Location

Party Site Point

Customer Organization Account Site Account


Account Address Site Use
Organization Party Party Site Use
Organization Profile Account Site Profile
Account Profile & & Profile Amounts
Profile Amounts

28 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Flow

Person Location

Organization Organization Organization Account Role


Account Role Responsibility
Contact Contact Address Contact Point

29 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps
Sample Data
1. Customer Account: Singapore Airlines Office
– Organization Party: Singapore Airlines
– Organization Profile
– Account Profile and Profile Amounts

2. Location: 1 Robinson Road, Singapore 601010

3. Organization Address: Singapore Airlines – 1 Robinson Road

4. Customer Account Site: Singapore Airlines Office – 1 Robinson


Road

30 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps
Sample Data

5. Customer Account Site Use: Singapore Airlines Office – 1


Robinson Road – BILL TO
– Party Site Use: Singapore Airlines – 1 Robinson Road – BILL TO
– Account Site Profile and Profile Amounts

6. Person: Stella Sia

7. Organization Contact: Stella Sia-Singapore Airlines

8. Location: 2 Robinson Road, Singapore 601020.

31 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps
Sample Data

9. Organization Contact Address: Stella Sia-Singapore Airlines – 2


Robinson Road

10. Contact Point: Stella Sia-Singapore Airlines – Phone 65-


7771212

11. Customer Account Role: Singapore Airlines Office - Stella Sia-


Singapore Airlines – CONTACT

12. Customer Account Role Responsibility: - Stella Sia-Singapore


Airlines – CONTACT – Bill to

32 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 1 – Customer Account
Create Account, Organization, Organization Profile, Account Profile,
and Account Profile Amount
(HZ_CUST_ACCOUNT_V2PUB.create_cust_account)
x_cust_account_id: 252705
x_account_number: 7660
x_party_id: 488974
x_party_number: 55446
x_profile_id: 415422
select cust_account_id, party_id, account_number,
account_name
from hz_cust_accounts
where cust_account_id = 252705;
CUST_ACCOUNT_ID PARTY_ID ACCOUNT_NUMBER ACCOUNT_NAME
252705 488974 7660 Singapore Airlines
Office

33 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 1 – Customer Account
HZ_CUST_ACCOUNT_V2PUB.create_cust_account (continued)

select party_id, party_number, party_type, party_name


from hz_parties
where party_id = 488974;
PARTY_ID PARTY_NUMBER PARTY_TYPE PARTY_NAME
488974 55446 ORGANIZATION Singapore Airlines

34 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 1 – Customer Account
HZ_CUST_ACCOUNT_V2PUB.create_cust_account (continued)
select organization_profile_id,party_id
from hz_organization_profiles
where organization_profile_id = 414426;
ORGANIZATION_PROFILE_ID PARTY_ID
415422 488974
select cust_account_profile_id, cust_account_id, party_id,
profile_class_id, site_use_id
from hz_customer_profiles
where cust_account_id = 252705;
CUST_ACCOUNT_PROFILE_ID CUST_ACCOUNT_ID PARTY_ID
PROFILE_CLASS_ID SITE_USE_ID
244818 252705 488974 0

35 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 1 – Customer Account
HZ_CUST_ACCOUNT_V2PUB.create_cust_account (continued)
select cust_acct_profile_amt_id, cust_account_profile_id,
cust_account_id, site_use_id, currency_code
from hz_cust_profile_amts
where cust_account_profile_id = 244818;
CUST_ACCT_ CUST_ACCOUNT_
PROFILE_AMT_ID PROFILE_ID CUST_ACCOUNT_ID SITE_USE_ID
CURRENCY_CODE
241143 244818 252705 CAD
241144 244818 252705 EUR
241145 244818 252705 GBP
241146 244818 252705 RUR
241147 244818 252705 SEK
241148 244818 252705 USD

36 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps
After step 1, we have:

1. Customer Account: Singapore Airlines Office cust_account_id=252705


 Organization Party: Singapore Airlines party_id=488974
 Organization Profile organization_profile_id=415422
 Account Profile and Profile Amounts cust_account_profile_id=244818

37 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


What’s It Look Like In The Application?

Where to look via Receivables (AR) Responsibility


 Navigate to: Customers -> Accounts

Where to look via Oracle Customers Online (OCO) Responsibility


 Navigate to: Customers -> Organizations

38 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account

AR: Customers -> Accounts

Click

39 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Profile

AR: Customers –>


Account –> Account Profile

40 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Profile Amounts

AR: Customers –>


Account –>
Profile Amounts

41 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customers Online Organization

OCO: Customers –>


Organization

42 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customers Organization Profile

OCO: Customers –>


Organization –>
Profile

43 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 2 – Location
Create Location (HZ_LOCATION_V2PUB.create_location)
x_location_id: 28964
select location_id,address1,city,postal_code
from hz_locations
where location_id = 28964;
LOCATION_ID ADDRESS1 CITY POSTAL_CODE
28964 1 Robinson Road Singapore 601010

44 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 3 - Party Site

Create Party Site (HZ_PARTY_SITE_V2PUB.create_party_site)


x_party_site_id: 357430
x_party_site_number: 26165
select party_site_id, party_id, location_id, party_site_number
from hz_party_sites
where party_site_id = 357430;
PARTY_SITE_ID PARTY_ID LOCATION_ID PARTY_SITE_NUMBER
357430 488974 28964 26165

45 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 4 - Customer Account Site
Create Customer Account Site
(HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_acct_site)

x_cust_acct_site_id: 13903

select cust_acct_site_id, cust_account_id, party_site_id,


org_id
from hz_cust_acct_sites_all
where cust_acct_site_id = 13903;

CUST_ACCT_SITE_ID CUST_ACCOUNT_ID PARTY_SITE_ID ORG_ID


13903 252705 357430 204

46 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Site
HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_acct_site

AR: Customers –>


Account –>
Account Site

47 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps

2. Location: 1 Robinson Road, Singapore 601010


location_id=28964

3. Organization Address: Singapore Airlines – 1 Robinson Road


party_site_id=357430

4. Customer Account Site: Singapore Airlines Office – 1 Robinson


Road
cust_acct_site_id=13903

48 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 5 - Customer Account Site Use
Create Account Site Use / Party Site Use / Account Site
Profile / Account Site Profile Amounts
(HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use)

x_site_use_id: 16390
select site_use_id, cust_acct_site_id, site_use_code,
location, org_id
from hz_cust_site_uses_all
where site_use_id = 16390;
SITE_USE_ID CUST_ACCT_SITE_ID SITE_USE_CODE LOCATION
ORG_ID
16390 13903 BILL_TO 16389
204

49 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 5 - Customer Account Site Use
Create Account Site Use / Party Site Use / Account Site Profile /
Account Site Profile Amounts
(HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use)

Party Site Use:


select party_site_use_id, party_site_id, site_use_type,
primary_per_type
from hz_party_site_uses
where party_site_id = 357430;
PARTY_SITE_USE_ID PARTY_SITE_ID SITE_USE_TYPE
PRIMARY_PER_TYPE
322876 357430 BILL_TO Y

50 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 5 - Customer Account Site Use
HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use
(continued)
Account Site Use Profile

select cust_account_profile_id, cust_account_id, party_id,


profile_class_id, site_use_id
from hz_customer_profiles
where cust_account_id = 252705;

CUST_ACCOUNT_PROFILE_ID CUST_ACCOUNT_ID PARTY_ID


PROFILE_CLASS_ID SITE_USE_ID
244818 252705 488974 0
245819 252705 488974 0
16390

51 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 5 - Customer Account Site Use
HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use (continued)

Account Site Use Profile Amounts

select cust_acct_profile_amt_id, cust_account_profile_id,


cust_account_id, site_use_id, currency_code
from hz_cust_profile_amts
where cust_account_profile_id = 245819;

CUST_ CUST_
ACCT_PROFILE_AMT_ID ACCOUNT_PROFILE_ID CUST_ACCOUNT_ID
SITE_USE_ID CURRENCY_CODE
242143 245819 252705 16390 CAD
242144 245819 252705 16390 EUR
242145 245819 252705 16390 GBP
242146 245819 252705 16390 RUR
242147 245819 252705 16390 SEK
242148 245819 252705 16390 USD

52 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 5 - Customer Account Site Use
HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use

AR: Customers –>


Account –> Account
Site –> Business
Purposes

53 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 5 - Customer Account Site Use
HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use

AR: Customers –> Account –>


Account Site –> Profile

54 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 5 - Customer Account Site Use
HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use

AR: Customers –>


Account –> Account
Site –> Profile Amounts

55 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps

5. Customer Account Site Use: Singapore Airlines Office – 1


Robinson Road – BILL TO site_use_id=16390
 Party Site Use: Singapore Airlines – 1 Robinson Road –
BILL TO party_site_use_id=322876
 Account Site Profile and Profile Amounts
cust_account_profile_id=245819

56 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 6 - Person
Create Person
(HZ_PARTY_V2PUB.create_person)
X_party_id := 490974;
Select party_id, party_type, party_name from hz_parties
Where party_id = 490974;
PARTY_ID PARTY_TYPE PARTY_NAME
-------- ---------- ----------
490974 PERSON Stella Sia

57 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 7 - Organization Contact
Create Organization Contact
(HZ_PARTY_CONTACT_V2PUB.create_org_contact)
Attribute values:
p_org_contact_rec.party_rel_rec.subject_id := 490974; --
Stella Sia
p_org_contact_rec.party_rel_rec.subject_type :='PERSON';
p_org_contact_rec.party_rel_rec.subject_table_name :=
'HZ_PARTIES';
p_org_contact_rec.party_rel_rec.object_id := 488974; --
Singapore Airlines
p_org_contact_rec.party_rel_rec.object_type
:='ORGANIZATION';
p_org_contact_rec.party_rel_rec.object_table_name :=
'HZ_PARTIES';
p_org_contact_rec.party_rel_rec.relationship_type :=
'CONTACT';
p_org_contact_rec.party_rel_rec.relationship_code :=
'CONTACT_OF';

58 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 7 - Organization Contact
HZ_PARTY_CONTACT_V2PUB.create_org_contact (continued)
x_org_contact_id = 186069
x_party_rel_id = 643026
x_party_id = 490975
x_party_number = 55488
select org_contact_id, party_relationship_id
from hz_org_contacts
where org_contact_id = 186069;
ORG_CONTACT_ID PARTY_RELATIONSHIP_ID
-------------- ---------------------
186069 643026

59 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 7 - Organization Contact
HZ_PARTY_CONTACT_V2PUB.create_org_contact (continued)
Relationship:
select relationship_id, subject_id, subject_type,
subject_table_name,
object_id, object_type, object_table_name, directional_flag
relationship_type, relationship_code, party_id
from hz_relationships
where relationship_id = 643026;
RELATIONSHIP_ID SUBJECT_ID SUBJECT_TYPE SUBJECT_TABLE_NAME
OBJECT_ID OBJECT_TYPE OBJECT_TABLE_NAME DIRECTIONAL_FLAG
RELATIONSHIP_TYPE RELATIONSHIP_CODE PARTY_ID
643026 488974 ORGANIZATION HZ_PARTIES 490974 PERSON
HZ_PARTIES B CONTACT 490975
643026 490974 PERSON HZ_PARTIES 488974 ORGANIZATION
HZ_PARTIES F CONTACT_OF 490975

60 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 7 - Organization Contact
HZ_PARTY_CONTACT_V2PUB.create_org_contact (continued)

Relationship party:
select party_id, party_number, party_type, party_name
from hz_parties
where party_id = 490975;
PARTY_ID PARTY_NUMBER PARTY_TYPE PARTY_NAME
490975 55488 PARTY_RELATIONSHIP Stella Sia-Singapore
Airlines-55488

61 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Organization Contact
HZ_PARTY_CONTACT_V2PUB.create_org_contact

OCO: Organization –>


Relationships –>
Contacts

62 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Organization Contact
HZ_PARTY_CONTACT_V2PUB.create_org_contact

OCO: Persons (Organization Contact link)

63 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps

6. Person: Stella Sia party_id=490974

7. Organization Contact: Stella Sia-Singapore Airlines


org_contact_id=186069

64 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 8 - Contact Person Address
Create Location (HZ_LOCATION_V2PUB.create_location)
x_location_id: 28985
select location_id,address1,city,postal_code
from hz_locations
where location_id = 28985;
LOCATION_ID ADDRESS1 CITY POSTAL_CODE
28985 2 Robinson Road Singapore 601020

65 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 9 - Contact Person Address
Create Party Site (HZ_PARTY_SITE_V2PUB.create_party_site)

x_party_site_id: 358431
x_party_site_number: 26185
select party_site_id, party_id, location_id,
party_site_number
from hz_party_sites
where party_site_id = 358431;
PARTY_SITE_ID PARTY_ID LOCATION_ID PARTY_SITE_NUMBER
358431 490975 28985 26185

66 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Contact Person Address
HZ_LOCATION_V2PUB.create_location
HZ_PARTY_SITE_V2PUB.create_party_site

OCO: Contact Person –> Addresses

67 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps

8. Location: 2 Robinson Road, Singapore 601020,


location_id=28985

9. Organization Contact Address: Stella Sia-Singapore Airlines –


2 Robinson Road party_site_id=358431

68 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 10 - Contact Person Contact Point
Create Contact Point
(HZ_CONTACT_POINT_V2PUB.create_contact_point)
x_contact_point_id: 350447

select contact_point_id, contact_point_type, owner_table_name,


owner_table_id, primary_flag, phone_country_code,
phone_number
from hz_contact_points
where contact_point_id = 350447;

CONTACT_ CONTACT_ OWNER_ OWNER_ PRIMARY PHONE_ PHONE_


POINT_ID POINT_TYPE TABLE_NAME TABLE_ID _FLAG COUNTRY_ NUMBER
CODE

350447 PHONE HZ_PARTIES 490975 Y 65 6777-1212

69 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Contact Person Contact Point
HZ_CONTACT_POINT_V2PUB.create_contact_point

OCO: Contact Person –>


Contact Points

70 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Contact Person Contact Point
HZ_CONTACT_POINT_V2PUB.create_contact_point

OCO: Organization –>


Relationships –>
Contacts

71 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps

10. Contact Point: Stella Sia-Singapore Airlines – Phone 65-


7771212 contact_point_id=350447

72 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 11 - Customer Account Role
Create Customer Account Role
(HZ_CUST_ACCOUNT_ROLE_V2PUB.create_cust_account_role)
x_cust_account_role_id=81851

select cust_account_role_id, party_id, cust_account_id,


cust_acct_site_id, role_type
from hz_cust_account_roles
where cust_account_role_id = 81851;

CUST_ACCOUNT_ROLE_ID PARTY_ID CUST_ACCOUNT_ID CUST_ACCT_SITE_ID


ROLE_TYPE
81851 490975 252705 CONTACT

73 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Role
HZ_CUST_ACCOUNT_ROLE_V2PUB.create_cust_account_role

AR: Customers –>


Accounts –>
Communication –>
Account Contacts

Click

74 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Role
HZ_CUST_ACCOUNT_ROLE_V2PUB.create_cust_account_role

AR: Customers –> Accounts –>


Communication –> Account Contacts

75 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Flow
11. Customer Account Role: Singapore Airlines Office - Stella Sia-
Singapore Airlines – CONTACT cust_account_role_id=81851

76 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Step 12 - Customer Account Role Responsibility
Create Customer Account Role Responsibility
(HZ_CUST_ACCOUNT_ROLE_V2PUB.create_role_responsibility)
x_responsibility_id=34406

select
responsibility_id,cust_account_role_id,responsibility_typ
e,primary_flag
from hz_role_responsibility
where responsibility_id = 34406;

RESPONSIBILITY_ID CUST_ACCOUNT_ROLE_ID RESPONSIBILITY_TYPE


PRIMARY_FLAG
34406 81851 BILL_TO Y

77 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Role
HZ_CUST_ACCOUNT_ROLE_V2PUB. create_role_responsibility

AR: Customers –> Accounts –> Communication


–> Account Contacts –> Contact Roles

78 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps
12. Customer Account Role Responsibility: - Stella Sia-Singapore
Airlines – CONTACT – Bill To responsibility_id=34406

79 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps Completed
1. Customer Account: Singapore Airlines Office
cust_account_id=252705
 Organization Party: Singapore Airlines party_id=488974
 Organization Profile organization_profile_id=415422
 Account Profile and Profile Amounts
cust_account_profile_id=244818

2. Location: 1 Robinson Road, Singapore 601010 location_id=28964

3. Organization Address: Singapore Airlines – 1 Robinson Road


party_site_id=357430

4. Customer Account Site: Singapore Airlines Office – 1 Robinson Road


cust_acct_site_id=13903

80 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps Completed

5. Customer Account Site Use: Singapore Airlines Office – 1 Robinson


Road – BILL TO site_use_id=16390
 Party Site Use: Singapore Airlines – 1 Robinson Road – BILL TO
party_site_use_id=322876
 Account Site Profile and Profile Amounts
cust_account_profile_id=245819

6. Person: Stella Sia party_id=490974

7. Organization Contact: Stella Sia-Singapore Airlines


org_contact_id=186069

8. Location: 2 Robinson Road, Singapore 601020, location_id=28985

81 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Customer Account Creation Steps Completed

9. Organization Contact Address: Stella Sia-Singapore Airlines – 2


Robinson Road party_site_id=358431

10. Contact Point: Stella Sia-Singapore Airlines – Phone 65-7771212


contact_point_id=350447

11. Customer Account Role: Singapore Airlines Office - Stella Sia-


Singapore Airlines – CONTACT cust_account_role_id=81851

12. Customer Account Role Responsibility: - Stella Sia-Singapore


Airlines – CONTACT – Bill To responsibility_id=34406

82 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example of Update Customer Account
HZ_CUST_ACCOUNT_V2PUB.update_cust_account
DECLARE
p_init_msg_list VARCHAR2(1) := FND_API.G_TRUE;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
p_cust_account_rec
HZ_CUST_ACCOUNT_V2PUB.CUST_ACCOUNT_REC_TYPE;
p_object_version_number NUMBER;
BEGIN
select object_version_number into p_object_version_number
from hz_cust_accounts
where cust_account_id = 252705;

83 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example of Update Customer Account
HZ_CUST_ACCOUNT_V2PUB.update_cust_account (continued)
p_cust_account_rec.cust_account_id := 252705;
p_cust_account_rec.account_name := 'Singapore Airlines
Limited';
hz_cust_account_v2pub.update_cust_account(
p_init_msg_list,
p_cust_account_rec,
p_object_version_number,
x_return_status,
x_msg_count,
x_msg_data);
dbms_output.put_line('x_return_status: '||x_return_status);
dbms_output.put_line('x_msg_count: '||x_msg_count);
dbms_output.put_line('x_msg_data: '||x_msg_data);
dbms_output.put_line('p_object_version_number='||
p_object_version_number);
END;

84 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example of Update Customer Account
HZ_CUST_ACCOUNT_V2PUB.update_cust_account
Before Update
select cust_account_id, account_name, object_version_number
from hz_cust_accounts
where cust_account_id = 252705;

CUSTOMER_ACCOUNT_ID ACCOUNT_NAME
OBJECT_VERSION_NUMBER
252705 Singapore Airlines Office 1

Execute the PL/SQL


x_return_status: S
x_msg_count: 0
x_msg_data:
p_object_version_number=2

85 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example of Update Customer Account
HZ_CUST_ACCOUNT_V2PUB.update_cust_account
After Update
select cust_account_id, account_name, object_version_number
from hz_cust_accounts
where cust_account_id = 252705;

CUSTOMER_ACCOUNT_ID ACCOUNT_NAME
OBJECT_VERSION_NUMBER
252705 Singapore Airlines Limited 2
END;

86 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Summary
What we covered today
 How to use the TCA APIs to create
Customer Account Data
 Customer Account creation flow
 How data is captured in the TCA
data model
 How this data appears in the Customers
user interface

87 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Top Articles and Community Links
 Please refer to the eTRM at
http://etrm.oracle.com/ for more details
on all Oracle tables.

 Oracle® Trading Community


Architecture Technical Implementation
Guide for detailed descriptions of TCA
APIs

 Release 11i, Part No. B13890-01

 Release 12, Part No. B25895-01

88 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Top Articles and Community Links
 Continue the discussion! For follow
up questions on topics covered in this
webcast, connect via this Receivables
Community thread:
https://communities.oracle.com/portal/se
rver.pt/community/view_discussion_topi
c/216?threadid=698501

 Receivables Community:
https://communities.oracle.com/portal/se
rver.pt/community/receivables/233

89 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Stay Connected
Oracle E-Business Suite Support Social Media Channels

 Twitter: @Oracle_EBS
 Facebook: OracleEBusinessSuiteSupport
 Blog: http://blogs.oracle.com/EBS
 My Oracle Support EBS Community:
https://communities.oracle.com/portal/server.pt/community/oracle
_e-business_suite/228

90 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Oracle Advisor Webcast Program
Locating Current Schedule & Archived Recordings

1. Access main Advisor


Webcast schedule &
archive via Doc ID
740966.1.
2. Select area of interest
from drop down list of
values. For example,
E-Business Suite (EBS).

91 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Oracle Advisor Webcast Program
Locating Current Schedule & Archived Recordings For EBS

1. Alternatively, access the


EBS page directly via
Doc ID 1455369.1.
2. Select area of interest
from the drop down list of
values.

92 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Oracle Advisor Webcast Program
Locating Current Schedule & Archived Recordings For EBS
Note:
 Click on a column heading
to sort by that column.
 Hover on Webcast Title for
more detailed information.
 Continue the discussion on
the Webcast or ask
questions on topics covered
via the Questions? link.
 Recordings available within
48 hours.

93 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Visit My Oracle Support Community
 Collaborate with industry peers, support professionals, and Oracle experts. Find out how
your peers are using Oracle technologies and services to better meet their needs.
• Exchange Knowledge
• Resolve Issues
• Gain Expertise

To access your My Oracle Support Community:


1. Log into My Oracle Support.
2. Select the Community tab.
3. Select your Community of interest from the My
Communities menu on the left side of the screen.

94 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Learn More
Available References and Resources to Get Proactive

 About Oracle Support Best Practices


www.oracle.com/goto/proactivesupport

 Get Proactive in My Oracle Support


https://support. oracle.com | Doc ID: 432.1

 Get Proactive Blog


https://blogs.oracle.com/getproactive/

 Ask the Get Proactive Team


get-proactive_ww@oracle.com

95 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Questions & Answers

Please ask questions on this topic via


the Receivables Community thread:
https://communities.oracle.com/portal/se
rver.pt/community/view_discussion_topic
/216?threadid=698501

96 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


THANK YOU

97 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


98 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

You might also like