Sunteți pe pagina 1din 4

D

o
c
I
D
TCA API: How to Change the Account Number
To
in Customer Register via API ? (Doc ID Bottom
1134034.1)

Modified:Jan 11, 2016 Type:HOWTO

In this Document

Goal
Solution

APPLIES TO:

Oracle Trading Community - Version 12.0.1 and later


Information in this document applies to any platform.

GOAL

How to Change the Customer Number via TCA API?

NOTE: You can use the same API shown below to update other fields in the customer
account record.

SOLUTION

The account number for an account can be updated if AUTO CUSTOMER NUMBERING
is off, but cannot be updated if AUTO CUSTOMER NUMBERING is on.

In order to change the Account Number for an existing customer, you first need to
check if Auto Customer Numbering is off:

Responsibility: Receivables Manager


Navigation: Setup > System > System Options

 under Trans and Customers tab


 make sure the Automatic Customer Numbering checkbox is NOT checked.

To change the Account number, you use the


hz_cust_account_v2pub.update_cust_account API.

Following illustrates how this is done, please note all ID values are specific to the test
environment:

Pick a Customer record to update:

select party_id, party_name from hz_parties where party_name ='Jackie


CUST01' and status ='A';

PARTY_ID PARTY_NAME
---------- ----------------------
303602 Jackie CUST01

Check the current value of Account Number, so you can verify after if the value has
indeed changed:

select account_number, cust_account_id, status, object_version_number


from hz_cust_accounts where party_id = 303602;

ACCOUNT_NUMBER CUST_ACCOUNT_ID S OBJECT_VERSION_NUMBER


-------------- --------------- - ---------------------
5447 96166 A 6

Following is sample code:

exec dbms_application_info.set_client_info('204');

set serveroutput on;

DECLARE
p_cust_account_rec HZ_CUST_ACCOUNT_V2PUB.CUST_ACCOUNT_REC_TYPE;
p_object_version_number NUMBER := 6;
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
BEGIN
fnd_client_info.set_org_context('204');
p_cust_account_rec.cust_account_id := 96166;
p_cust_account_rec.account_name := FND_API.G_MISS_CHAR;
p_cust_account_rec.account_number :='5447Change';

hz_cust_account_v2pub.update_cust_account (
'T',
p_cust_account_rec,
p_object_version_number,
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('Object Version Number
='||TO_CHAR(p_object_version_number));
dbms_output.put_line('x_msg_data = '|| SUBSTR (x_msg_data,1,255));

END;
/

Output shows:

x_return_status = S
x_msg_count = 0
Object Version Number =7
x_msg_data =

PL/SQL procedure successfully completed.

Verify new value of Account Number

select account_number, cust_account_id, status, object_version_number


from hz_cust_accounts where party_id = 303602;

ACCOUNT_NUMBER CUST_ACCOUNT_ID S OBJECT_VERSION_NUMBER


-------------- --------------- - ---------------------
5447Change 96166 A 7

The Account Number has been changed from 5447 to 5447Change.

Didn't find what you are looking for? Ask in Community...


R
e
l
a
t
e
d
P
r
o
d
u
c
t
s

 Oracle E-Business Suite > Master Data Management > Customer > Oracle Trading Community > APIs > API Issues

K
e
y
w
o
r
d
s
ACCOUNT NUMBER; API; HZ_CUST_ACCOUNT_V2PUB; TCA

Back to Top
f1 !-15qiu9a6g9

OK

OKCancel

S-ar putea să vă placă și