TCA API's Samples

21
Scope This article will cover: •Categories of Customer Entities •TCA API Coding Steps •Example of Customer Account Creation using TCA APIs Details CUSTOMER ENTITIES Party Layer APIs Customer Entities can be grouped under two main categories – Party layer and Account layer entities. These are the main entities that are used for Receivables Customer information. A party entity must exist before the Account entity can be created. They can be created using the Party APIs given here. However, some party entities can also be created together with the Account, using the Account APIs. Entity API Tables Party – Organiz ation HZ_PARTY_V2PUB.create_organizati on HZ_PARTIES HZ_ORGANIZATION_PROFI LES Party - Person HZ_PARTY_V2PUB.create_person HZ_PARTIES HZ_PERSON_PROFILES Locatio n HZ_LOCATION_V2PUB.create_locatio n HZ_LOCATIONS 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

description

TCA api's sample data

Transcript of TCA API's Samples

Page 1: TCA API's Samples

Scope

This article will cover:

•Categories of Customer Entities •TCA API Coding Steps •Example of Customer Account Creation using TCA APIs

Details

CUSTOMER ENTITIES

Party Layer APIs

Customer Entities can be grouped under two main categories – Party layer and Account layer entities. These are the main entities that are used for Receivables Customer information. A party entity must exist before the Account entity can be created. They can be created using the Party APIs given here.However, some party entities can also be created together with the Account, using the Account APIs.

Entity API Tables

Party – Organization

HZ_PARTY_V2PUB.create_organization HZ_PARTIESHZ_ORGANIZATION_PROFILES

Party - Person

HZ_PARTY_V2PUB.create_person HZ_PARTIESHZ_PERSON_PROFILES

Location HZ_LOCATION_V2PUB.create_location HZ_LOCATIONSHZ_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

Party Contact (Organization Contact)

HZ_PARTY_CONTACT_V2PUB.create_org_contact

HZ_ORG_CONTACTSHZ_RELATIONSHIPS(Subject: Contact person Object: Organization/Person)HZ_PARTIES

Page 2: TCA API's Samples

(party_type=PARTY_RELATIONSHIP)

Contact Role

HZ_PARTY_CONTACT_V2PUB.create_org_contact_role

HZ_ORG_CONTACT_ROLES

Contact Point

HZ_CONTACT_POINT_V2PUB.create_contact_pointHZ_CONTACT_POINT_V2PUB.create_phone_contact_pointHZ_CONTACT_POINT_V2PUB.create_email_contact_pointHZ_CONTACT_POINT_V2PUB.create_web_contact_pointHZ_CONTACT_POINT_V2PUB.create_telex_contact_pointHZ_CONTACT_POINT_V2PUB.create_edi_contact_pointHZ_CONTACT_POINT_V2PUB.create_eft_contact_point

HZ_CONTACT_POINTSOwner_table_name=HZ_PARTIES and owner_table_id=party_idOrOwner_table_name=HZ_PARTY_SITES and owner_table_id=party_site_id

Account Layer APIs

Entity API Tables

Customer Account

HZ_CUST_ACCOUNT_V2PUB.create_cust_account

HZ_CUST_ACCOUNTSHZ_PARTIESHZ_CUSTOMER_PROFILESHZ_CUST_PROFILE_AMTS

Account Site

HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_acct_site

HZ_CUST_ACCT_SITES_ALL

Account Site Use

HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_use

HZ_CUST_SITE_USES_ALLHZ_CUSTOMER_PROFILESHZ_CUST_PROFILE_AMTS

Account Relationship

HZ_CUST_ACCOUNT_V2PUB. create_cust_acct_relate

HZ_CUST_ACCT_RELATE_ALL

Account / Account Site Use Profile

HZ_CUSTOMER_PROFILE_V2PUB.create_customer_profile

HZ_CUSTOMER_PROFILESHZ_CUST_PROFILE_AMTS

Page 3: TCA API's Samples

Account / Account Site Use Profile Amount

HZ_CUSTOMER_PROFILE_V2PUB.create_cust_profile_amt

HZ_CUST_PROFILE_AMTS

Account / Account Site Role (Contact)

HZ_CUST_ACCOUNT_ROLE_V2PUB.create_cust_account_role

HZ_CUST_ACCOUNT_ROLES

Account / Account Site Role Responsibility

HZ_CUST_ACCOUNT_ROLE_V2PUB.create_role_responsibility

HZ_ROLE_RESPONSIBILITY

Customer Account Creation Flow

Sample Code Structure:

Login to SQLPLUS with user APPS.

-- Set operating unit contextmo_global.init('S',&operating_unit_id);

-- PL/SQL procedure to runset serveroutput onDECLARE-- Standard IN/OUT parameter variablesp_init_msg_list VARCHAR2(1) := FND_API.G_TRUE;x_return_status VARCHAR2(2000);x_msg_count NUMBER;x_msg_data VARCHAR2(2000);

-- API Record Type variablep_person_rec HZ_PARTY_V2PUB.PERSON_REC_TYPE;

Page 4: TCA API's Samples

-- API output parameter variablesx_party_id NUMBER;x_party_number VARCHAR2(2000);x_profile_id NUMBER;BEGIN-- Values to pass to APIp_person_rec.person_first_name := 'Ash';p_person_rec.person_last_name := 'Lee';p_person_rec.created_by_module := 'TCA_V2_API';

-- API to callHZ_PARTY_V2PUB.create_person (p_init_msg_list,p_person_rec,x_party_id,x_party_number,x_profile_id,x_return_status,x_msg_count,x_msg_data);

-- Result status and error handlingdbms_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 THENFOR I IN 1..x_msg_count LOOPdbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));END LOOP;END IF;

-- Display API output parametersdbms_output.put_line('x_party_id = '|| x_party_id);dbms_output.put_line('x_party_number = '|| x_party_number);dbms_output.put_line('x_profile_id = '|| x_profile_id);

EXCEPTIONwhen others then dbms_output.put_line(sqlerrm(sqlcode));END;

Sample Flow:1. Customer Account: Model Artworks Asia•Organization Party: Model Artworks

Page 5: TCA API's Samples

•Organization Profile•Account Profile and Profile Amounts2. Location: 1 Robinson Road, Singapore 6010103. Organization Address: Model Artworks – 1 Robinson Road4. Customer Account Site: Model Artworks Asia – 1 Robinson Road5. Customer Account Site Use: Model Artworks Asia – 1 Robinson Road – BILL TO•Party Site Use: Model Artworks – 1 Robinson Road – BILL TO•Account Site Profile and Profile Amounts6. Person: Ash Lee7. Organization Contact: Ash Lee – Model Artworks8. Location: 2 Robinson Road, Singapore 601020.9. Organization Contact - Address: Ash Lee – Model Artworks – 2 Robinson Road10. Organization Contact - Contact Point: Ash Lee – Model Artworks – Phone 65-777121211. Customer Account Role: Model Artworks Asia - Ash Lee – Model Artworks – CONTACT12. Customer Account Role Responsibility: - Ash Lee – Model Artworks – CONTACT – Bill to

1. Create Account / Organization / Organization Profile / Account Profile / Account Profile Amount

API: HZ_CUST_ACCOUNT_V2PUB.create_cust_accountRecord type variables: p_cust_account_rec HZ_CUST_ACCOUNT_V2PUB.CUST_ACCOUNT_REC_TYPE;p_organization_rec HZ_PARTY_V2PUB.ORGANIZATION_REC_TYPE;p_customer_profile_rec HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE;Output variables:x_cust_account_id NUMBER;x_account_number VARCHAR2(2000);x_party_id NUMBER;x_party_number VARCHAR2(2000);x_profile_id NUMBER;Values to pass to API:p_cust_account_rec.account_name := 'Model Artworks Asia';p_cust_account_rec.created_by_module := 'TCA_V2_API';p_organization_rec.organization_name := 'Model Artworks';p_organization_rec.created_by_module := 'TCA_V2_API';

Output:x_cust_account_id: 252705x_account_number: 7660

Page 6: TCA API's Samples

x_party_id: 488974x_party_number: 55446x_profile_id: 415422

Query Data:select cust_account_id, party_id, account_number, account_namefrom hz_cust_accountswhere cust_account_id = 252705;

CUST_ACCOUNT_ID PARTY_ID ACCOUNT_NUMBER ACCOUNT_NAME252705 488974 7660 Model Artworks Asia

select party_id, party_number, party_type, party_namefrom hz_partieswhere party_id = 488974;

PARTY_ID PARTY_NUMBER PARTY_TYPE PARTY_NAME488974 55446 ORGANIZATION Model Artworks

select organization_profile_id,party_idfrom hz_organization_profileswhere organization_profile_id = 414426;

ORGANIZATION_PROFILE_ID PARTY_ID415422 488974

select cust_account_profile_id, cust_account_id, party_id, profile_class_id, site_use_idfrom hz_customer_profileswhere cust_account_id = 252705;

CUST_ACCOUNT_PROFILE_ID CUST_ACCOUNT_ID PARTY_ID PROFILE_CLASS_ID SITE_USE_ID244818 252705 488974 0

select cust_acct_profile_amt_id, cust_account_profile_id, cust_account_id, site_use_id, currency_codefrom hz_cust_profile_amtswhere cust_account_profile_id = 244818;

CUST_ACCT_ CUST_ACCOUNT_PROFILE_AMT_ID PROFILE_ID CUST_ACCOUNT_ID SITE_USE_ID CURRENCY_CODE241143 244818 252705 CAD241144 244818 252705 EUR241145 244818 252705 GBP241146 244818 252705 RUR

Page 7: TCA API's Samples

241147 244818 252705 SEK241148 244818 252705 USD

Navigation: Receivables> Customers> Query Name = Model Artworks

Receivables> Customers> Accounts> Account – Model Artworks Asia [Details] > Account Profile

Receivables> Customers> Accounts> Account – Model Artworks Asia [Details] > Profile Amounts

For Party and Organization Profile:Oracle Customers Online> Customers> Organizations> Query Name = Model Artworks> Click on Name link> Profile

2. Create Location for Organization Address

API: HZ_LOCATION_V2PUB.create_locationRecord type variables:p_location_rec HZ_LOCATION_V2PUB.LOCATION_REC_TYPE;Output variables:x_location_id NUMBER;Values to pass to API:p_location_rec.country := 'SG';p_location_rec.address1 := '1 Robinson Road';p_location_rec.city := 'Singapore';p_location_rec.postal_code := '601010';p_location_rec.created_by_module := 'TCA_V2_API';

Output:x_location_id: 28964

Query Data:select location_id,address1,city,postal_codefrom hz_locationswhere location_id = 28964;

LOCATION_ID ADDRESS1 CITY POSTAL_CODE

Page 8: TCA API's Samples

28964 1 Robinson Road Singapore 601010

3. Organization Address - Create Party Site

API: HZ_PARTY_SITE_V2PUB.create_party_siteRecord type variables:p_party_site_rec HZ_PARTY_SITE_V2PUB.PARTY_SITE_REC_TYPE;Output variables:x_party_site_id NUMBER;x_party_site_number VARCHAR2(2000);Values to pass to API:p_party_site_rec.party_id := 488974; -- value of party_id from step 1 p_party_site_rec.location_id := 28964; -- value of location_id from step 2 p_party_site_rec.identifying_address_flag := 'Y';p_party_site_rec.created_by_module := 'TCA_V2_API';

Output:x_party_site_id: 357430x_party_site_number: 26165

Query Data:select party_site_id, party_id, location_id, party_site_numberfrom hz_party_siteswhere party_site_id = 357430;

PARTY_SITE_ID PARTY_ID LOCATION_ID PARTY_SITE_NUMBER357430 488974 28964 26165

Navigation:Oracle Customers Online> Customers> Organizations> Query Name = Model Artworks> Click on Name link> Addresses

4. Create Customer Account Site

API: HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_acct_siteRecord type variables:p_cust_acct_site_rec hz_cust_account_site_v2pub.cust_acct_site_rec_type;Output variables:x_cust_acct_site_id NUMBER;Values to pass to API:p_cust_acct_site_rec.cust_account_id := 252705; -- value of cust_account_id from step 1p_cust_acct_site_rec.party_site_id := 357430; -- value of party_site_id from step 3

Page 9: TCA API's Samples

p_cust_acct_site_rec.created_by_module := 'TCA_V2_API';

Output:x_cust_acct_site_id: 13903

Query Data:select cust_acct_site_id, cust_account_id, party_site_id, org_idfrom hz_cust_acct_sites_allwhere cust_acct_site_id = 13903;

CUST_ACCT_SITE_ID CUST_ACCOUNT_ID PARTY_SITE_ID ORG_ID13903 252705 357430 204

Navigation:Receivables> Customers> Accounts> Account – Model Artworks Asia [Details]> Account> Sites

5. Create Account Site Use / Party Site Use / Account Site Profile / Account Site Profile Amounts

API: HZ_CUST_ACCOUNT_SITE_V2PUB.create_cust_site_useRecord type variables:p_cust_site_use_rec HZ_CUST_ACCOUNT_SITE_V2PUB.CUST_SITE_USE_REC_TYPE;p_customer_profile_rec HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE;Output variables:x_site_use_id NUMBER;Values to pass to API:p_cust_site_use_rec.cust_acct_site_id := 13903; -- value of cust_acct_site_id from step 4p_cust_site_use_rec.site_use_code := 'BILL_TO';p_cust_site_use_rec.created_by_module := 'TCA_V2_API';select hz_cust_site_uses_s.nextval into p_location from dual;p_cust_site_use_rec.location := p_location;

Output:x_site_use_id: 16390

Query Data:select site_use_id, cust_acct_site_id, site_use_code, location, org_idfrom hz_cust_site_uses_allwhere site_use_id = 16390;

Page 10: TCA API's Samples

SITE_USE_ID CUST_ACCT_SITE_ID SITE_USE_CODE LOCATION ORG_ID16390 13903 BILL_TO 16389 204

Party Site Use:

select party_site_use_id, party_site_id, site_use_type, primary_per_typefrom hz_party_site_useswhere party_site_id = 357430;

PARTY_SITE_USE_ID PARTY_SITE_ID SITE_USE_TYPE PRIMARY_PER_TYPE322876 357430 BILL_TO Y

Account Site Use Profile:

select cust_account_profile_id, cust_account_id, party_id, profile_class_id, site_use_idfrom hz_customer_profileswhere cust_account_id = 252705;

CUST_ACCOUNT_PROFILE_ID CUST_ACCOUNT_ID PARTY_ID PROFILE_CLASS_ID SITE_USE_ID244818 252705 488974 0245819 252705 488974 0 16390

Account Site Use Profile Amounts:

select cust_acct_profile_amt_id, cust_account_profile_id, cust_account_id, site_use_id, currency_codefrom hz_cust_profile_amtswhere 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 CAD242144 245819 252705 16390 EUR242145 245819 252705 16390 GBP242146 245819 252705 16390 RUR242147 245819 252705 16390 SEK242148 245819 252705 16390 USD

Navigation:Receivables> Customers> Accounts> Account – Model Artworks Asia [Details]> Sites> Account Sites [Details] – Business Purposes

Page 11: TCA API's Samples

Receivables> Customers> Accounts> Account – Model Artworks Asia [Details]> Sites [Details] – Profile

Receivables> Customers> Accounts> Account – Model Artworks Asia [Details]> Sites [Details] – Profile Amounts

Party Site Use:Oracle Customers Online> Customers> Organizations> Query Name = Model Artworks> Click on Name link> Addresses - Purpose

6. Create Person

API: HZ_PARTY_V2PUB.create_personRecord type variables:p_person_rec HZ_PARTY_V2PUB.PERSON_REC_TYPE;Output variables:x_party_id NUMBER;x_party_number VARCHAR2(2000);x_profile_id NUMBER;Values to pass to API:p_person_rec.person_first_name := 'Ash';p_person_rec.person_last_name := 'Lee';p_person_rec.created_by_module := 'TCA_V2_API';

Output:x_party_id = 490974

Query Data:Select party_id, party_nameFrom hz_partiesWhere party_id = 490974;

PARTY_ID PARTY_NAME490974 Ash Lee

Page 12: TCA API's Samples

Navigation:Oracle Customers Online> Customers> Persons> Query Name = Ash Lee

7. Create Organization Contact (Link Person to Organization)

API: HZ_PARTY_CONTACT_V2PUB.create_org_contactRecord type variables:p_org_contact_rec HZ_PARTY_CONTACT_V2PUB.org_contact_rec_type;Output variables:x_corg_contact_id NUMBER;x_cparty_rel_id NUMBER;x_cparty_id NUMBER;x_cparty_number VARCHAR2(2000);Values to pass to API:p_org_contact_rec.created_by_module := 'TCA_V2_API';p_org_contact_rec.party_rel_rec.subject_id:= 490974; -- value of party_id from step 6p_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; -- value of party_id from step 1p_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';p_org_contact_rec.party_rel_rec.status := 'A';

--For Organization Address level contact, assign following value: --p_org_contact_rec.party_site_id:=357430; -- value of party_site_id from step 3

Output:x_org_contact_id = 186069x_party_rel_id = 643026x_party_id = 490975x_party_number = 55488

Query Data:select org_contact_id, party_relationship_idfrom hz_org_contactswhere org_contact_id = 186069;

ORG_CONTACT_ID PARTY_RELATIONSHIP_ID

Page 13: TCA API's Samples

-------------- ---------------------186069 643026

Relationship:

select relationship_id, subject_id, subject_type, subject_table_name,object_id, object_type, object_table_name, directional_flagrelationship_type, relationship_code, party_idfrom hz_relationshipswhere 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

Relationship party:

select party_id, party_number, party_type, party_namefrom hz_partieswhere party_id = 490975;

PARTY_ID PARTY_NUMBER PARTY_TYPE PARTY_NAME490975 55488 PARTY_RELATIONSHIP Ash Lee-Model Artworks-55488

Navigation:Oracle Customers Online> Customers> Organizations> Query Name = Model Artworks> Click on Name link> Relationships> Contacts

8. Organization Contact Address – Create Location

API: HZ_LOCATION_V2PUB.create_locationRecord type variables:p_location_rec HZ_LOCATION_V2PUB.LOCATION_REC_TYPE;Output variables:x_location_id NUMBER;

Page 14: TCA API's Samples

Values to pass to API:p_location_rec.country := 'SG';p_location_rec.address1 := '2 Robinson Road';p_location_rec.city := 'Singapore';p_location_rec.postal_code := '601020';p_location_rec.created_by_module := 'TCA_V2_API';

Output:x_location_id: 28985

Query Data:select location_id,address1,city,postal_codefrom hz_locationswhere location_id = 28985;

LOCATION_ID ADDRESS1 CITY POSTAL_CODE28985 2 Robinson Road Singapore 601020

9. Organization Contact Address - Create Party Site

API: HZ_PARTY_SITE_V2PUB.create_party_siteRecord type variables:p_party_site_rec HZ_PARTY_SITE_V2PUB.PARTY_SITE_REC_TYPE;Output variables:x_party_site_id NUMBER;x_party_site_number VARCHAR2(2000);Values to pass to API:p_party_site_rec.party_id := 490975; -- value of party_id from step 7 p_party_site_rec.location_id := 28985; -- value of location_id from step 8 p_party_site_rec.identifying_address_flag := 'Y';p_party_site_rec.created_by_module := 'TCA_V2_API';

Output:x_party_site_id: 358431x_party_site_number: 26185

Query Data:select party_site_id, party_id, location_id, party_site_numberfrom hz_party_siteswhere party_site_id = 358431;

PARTY_SITE_ID PARTY_ID LOCATION_ID PARTY_SITE_NUMBER358431 488975 28985 26185

Navigation:Oracle Customers Online> Customers> Organizations> Query Name =

Page 15: TCA API's Samples

Model Artworks> Click on Name link> Relationships> Contacts – Address

10. Organization Contact - Create Contact Point – Phone number

API: HZ_CONTACT_POINT_V2PUB.create_contact_pointRecord type variables:p_contact_point_rec HZ_CONTACT_POINT_V2PUB.CONTACT_POINT_REC_TYPE;Output variables:p_edi_rec HZ_CONTACT_POINT_V2PUB.EDI_REC_TYPE;p_email_rec HZ_CONTACT_POINT_V2PUB.EMAIL_REC_TYPE;p_phone_rec HZ_CONTACT_POINT_V2PUB.PHONE_REC_TYPE;p_telex_rec HZ_CONTACT_POINT_V2PUB.TELEX_REC_TYPE;p_web_rec HZ_CONTACT_POINT_V2PUB.WEB_REC_TYPE;x_contact_point_id NUMBER;Values to pass to API:p_contact_point_rec.contact_point_type := 'PHONE';p_contact_point_rec.owner_table_name := 'HZ_PARTIES';p_contact_point_rec.owner_table_id := '490975'; -- value of party_id from step 7p_contact_point_rec.primary_flag := 'Y';p_contact_point_rec.contact_point_purpose := 'BUSINESS';p_phone_rec.phone_country_code := '65';p_phone_rec.phone_number := '6777-1212';p_phone_rec.phone_line_type := 'GEN';p_contact_point_rec.created_by_module := 'TCA_V2_API';

Output:x_contact_point_id: 350447

Query Data:select contact_point_id, contact_point_type, owner_table_name, owner_table_id, primary_flag, phone_country_code, phone_numberfrom hz_contact_pointswhere contact_point_id = 350447;

CONTACT_ CONTACT_ OWNER_ OWNER_ PRIMARY PHONE_ PHONE_POINT_ID POINT_TYPE TABLE_NAME TABLE_ID _FLAG COUNTRY_ NUMBERCODE

350447 PHONE HZ_PARTIES 490975 Y 65 6777-1212

Navigation:Oracle Customers Online> Customers> Organizations> Query Name =

Page 16: TCA API's Samples

Model Artworks> Click on Name link> Relationships> Contacts – Phone

11. Create Customer Account Role (Link Organization Contact to Customer Account)

API: HZ_CUST_ACCOUNT_ROLE_V2PUB.create_cust_account_roleRecord type variables:p_cust_account_role_rec HZ_CUST_ACCOUNT_ROLE_V2PUB.CUST_ACCOUNT_ROLE_REC_TYPE;Output variables:x_cust_account_role_id NUMBER;Values to pass to API:p_cust_account_role_rec.created_by_module := 'TCA_V2_API';p_cust_account_role_rec.party_id := 490975; -- value of party_id from step 7p_cust_account_role_rec.cust_account_id := 252705; -- value of cust_account_id from step 1p_cust_account_role_rec.role_type := 'CONTACT';p_cust_account_role_rec.status := 'A';

-- Note: If contact is at site level, assign value to cust_acct_site_id--p_cust_account_role_rec.cust_acct_site_id := 13903;

Output:x_cust_account_role_id=81851

Query Data:select cust_account_role_id, party_id, cust_account_id, cust_acct_site_id, role_typefrom hz_cust_account_roleswhere cust_account_role_id = 81851;

CUST_ACCOUNT_ROLE_ID PARTY_ID CUST_ACCOUNT_ID CUST_ACCT_SITE_ID ROLE_TYPE81851 490975 252705 CONTACT

Navigation:Receivables> Customers> Account – Model Artworks Asia [Details]> Communication> Account Contacts

Receivables> Customers> Account – Model Artworks Asia [Details]> Communication> Account Contacts [Details]

Page 17: TCA API's Samples

12. Create Customer Account Role Responsibility

API: HZ_CUST_ACCOUNT_ROLE_V2PUB.create_role_responsibilityRecord type variables:p_role_responsibility_rec HZ_CUST_ACCOUNT_ROLE_V2PUB.role_responsibility_rec_TYPE;Output variables:x_responsibility_id NUMBER;Values to pass to API:p_role_responsibility_rec.created_by_module := 'TCA_V2_API';p_role_responsibility_rec.cust_account_role_id:=81851; -- value of cust_account_role_id from step 11p_role_responsibility_rec.primary_flag:='Y';p_role_responsibility_rec.responsibility_type:='BILL_TO';

Output:x_responsibility_id=34406

Query Data:select responsibility_id,cust_account_role_id,responsibility_type,primary_flagfrom hz_role_responsibilitywhere responsibility_id = 34406;

RESPONSIBILITY_ID CUST_ACCOUNT_ROLE_ID RESPONSIBILITY_TYPE PRIMARY_FLAG34406 81851 BILL_TO Y

Navigation:Receivables> Customers> Account – Model Artworks Asia [Details]> Communication> Account Contacts [Details] > Contact Roles