Create Customer Account Site Use API

TCA Create Customer Account Site Use API

Name of the API : CREATE CUSTOMER ACCOUNT SITE USE
Base Tables Affected : HZ_CUST_SITE_USES
PL/SQL Procedure used : CREATE_CUST_SITE_USE
Package Used : HZ_CUST_ACCOUNT_SITE_V2PUB
Mandatory Parameters :
Parameter Name Parameter Type Data Type
p_init_msg_list IN VARCHAR2:= FND_API.G_FALSE
p_cust_site_use_rec IN CUST_SITE_USE_REC_TYPE
p_customer_profile_rec IN HZ_CUSTOMER_PROFILE_V2PUB.
CUSTOMER_PROFILE_REC_TYPE
p_create_profile IN VARCHAR2:=FND_API.G_TRUE
p_create_profile_amt IN VARCHAR2:=FND_API.G_TRUE
x_site_use_id OUT NUMBER
x_return_status OUT VARCHAR2
x_msg_count OUT NUMBER
x_msg_data OUT VARCHAR2

Procedure:

Note: p_create_profile indicates whether to create customer profile for the site use being created. If value equals to FND_API.G_TRUE, a profile will be created. Similarly, p_create_profile_amt indicates whether to create profile amounts for the customer profile being created. If value equals to FND_API.G_TRUE, 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 is processed only when p_create_profile equals to FND_API.G_TRUE.

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.sql)
b) Enter the values for the Cust_Account_Site_Id , 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.
c) To Select the Customer Account Site Id run the query:
SELECT cust_acct_site_id FROM hz_cust_acct_sites;
d) Set the organization id before running the script as :
EXEC fnd_client_info.set_org_context(‘<orgid>’); for 11i
OR For R12
EXEC mo_global.init (‘AR’);
EXEC mo_global.set_org_context(<org_id>, NULL, ‘AR’);
EXEC fnd_global.set_nls_context(‘AMERICAN’);
EXEC mo_global.set_policy_context(‘S’, <org_id>);

Example For Running a Create Customer Account Site Use API:

 Sample Output of the Create Customer Account Site Use Script:
x_return_status = S
x_msg_count = 0
Site Use Id = 15383
Site Use = INV
x_msg_data =

Script To Verify whether the Create Customer Account Site Use API is successful:

 

Leave a Reply