0% found this document useful (0 votes)
371 views

Oracle TCA Example - Update Email Oracle

This document provides an example of using the HZ_CONTACT_POINT_V2PUB API in an Oracle E-Business Suite R12.1.3 environment to mass update email addresses. The example code declares variables, initializes the Oracle Applications, runs a cursor to retrieve contact point IDs and versions to update, loops through the records to update the email address value using the API, and commits the changes.

Uploaded by

tracejm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
371 views

Oracle TCA Example - Update Email Oracle

This document provides an example of using the HZ_CONTACT_POINT_V2PUB API in an Oracle E-Business Suite R12.1.3 environment to mass update email addresses. The example code declares variables, initializes the Oracle Applications, runs a cursor to retrieve contact point IDs and versions to update, loops through the records to update the email address value using the API, and commits the changes.

Uploaded by

tracejm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Home > Blog >

Example - Using HZ_CONTACT_POINT_V2PUB to Mass


Update Email Addresses
posted Jun 30, 2014, 1:51 PM by Jay Tracewell
Below is a working example from Oracle eBS R12.1.3 environment on using this API:
DECLARE
l_phone_rec HZ_CONTACT_POINT_V2PUB.phone_rec_type;
l_email_rec HZ_CONTACT_POINT_V2PUB.email_rec_type;
l_contact_point_rec HZ_CONTACT_POINT_V2PUB.contact_point_rec_type;

l_contact_point_type VARCHAR2(100) := 'EMAIL' ;--'PHONE';
l_primary_flag VARCHAR2(1) := 'Y';
--l_area_code HZ_CONTACT_POINTS.phone_area_code % TYPE := '953';
--l_phone_number HZ_CONTACT_POINTS.phone_number % TYPE := '9667255';
l_email HZ_CONTACT_POINTS.email_address % TYPE := '[email protected]';
l_obj_num NUMBER := 1;

p_party_id HZ_PARTIES.party_id % TYPE;
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
x_return_status VARCHAR2(1000);

CURSOR C1 IS
select contact_point_id, object_version_number
from apps.hz_contact_points
where contact_point_type = 'EMAIL'
AND STATUS = 'A'
AND UPPER(EMAIL_ADDRESS) = '[email protected]'
;
BEGIN
DBMS_OUTPUT.ENABLE (buffer_size => NULL);
DBMS_OUTPUT.PUT_LINE('Starting of script');
--Apps initialization.
mo_global.init('ONT');
mo_global.set_policy_context('S', 81);
apps.fnd_global.apps_initialize ( user_id => 0 --sysadmin
,resp_id => 21623 --omsu
,resp_appl_id => 660 --ont
,security_group_id => 0);
FOR C1R IN C1
LOOP

l_email_rec.email_address := l_email;
--l_phone_rec.phone_area_code := l_area_code;
--l_phone_rec.phone_number := l_phone_number;
--l_phone_rec.phone_line_type := 'PHONE';

l_contact_point_rec.contact_point_type := l_contact_point_type; --PHONE primary and
secondary
l_contact_point_rec.status := 'A';
l_contact_point_rec.owner_table_name := 'HZ_PARTIES';
l_contact_point_rec.owner_table_id := p_party_id;
l_contact_point_rec.primary_flag := l_primary_flag;
l_contact_point_rec.content_source_type := 'USER_ENTERED';
l_contact_point_rec.contact_point_id := C1R.contact_point_id;
l_obj_num := C1R.object_version_number;

HZ_CONTACT_POINT_V2PUB.update_contact_point
( p_init_msg_list => fnd_api.g_false
, p_contact_point_rec => l_contact_point_rec
, p_email_rec => l_email_rec
--, p_phone_rec => l_phone_rec
, p_object_version_number => l_obj_num
, x_return_status => x_return_status
, x_msg_count => x_msg_count
, x_msg_data => x_msg_data
);
dbms_output.put_line('Return Status :' || x_return_status || ' |ContactPoint: ' ||
C1R.contact_point_id);
IF x_return_status <> 'S'
THEN
FOR k in 1 .. x_msg_count loop
x_msg_data := fnd_msg_pub.get
( p_msg_index => k
, p_encoded => 'F'
) ;
dbms_output.put_line('Error:' || x_msg_data);
END LOOP;
END IF;
END LOOP;
COMMIT;
END;

You might also like