Sample HZ API's script to Create Contacts and Contact Points in Oracle
1. Below Code will create Contact Point in Oracle.
DECLARE
P_CONTACT_POINT_REC HZ_CONTACT_POINT_V2PUB.CONTACT_POINT_REC_TYPE;
P_PHONE_REC HZ_CONTACT_POINT_V2PUB.PHONE_REC_TYPE;
P_EDI_REC_TYPE HZ_CONTACT_POINT_V2PUB.EDI_REC_TYPE;
P_EMAIL_REC_TYPE HZ_CONTACT_POINT_V2PUB.EMAIL_REC_TYPE;
P_TELEX_REC_TYPE HZ_CONTACT_POINT_V2PUB.TELEX_REC_TYPE;
P_WEB_REC_TYPE HZ_CONTACT_POINT_V2PUB.WEB_REC_TYPE;
X_RETURN_STATUS VARCHAR2 (1000);
X_CONTACT_POINT_ID NUMBER;
X_MSG_COUNT NUMBER;
X_MSG_DATA VARCHAR2 (1000);
BEGIN
P_CONTACT_POINT_REC.CONTACT_POINT_TYPE := 'EMAIL';
P_CONTACT_POINT_REC.OWNER_TABLE_NAME := 'HZ_PARTIES';
P_CONTACT_POINT_REC.OWNER_TABLE_ID := 150336; ---L_ORG_PARTY_ID; commented by pranay tiwari on 05-Jun-2014
P_CONTACT_POINT_REC.CREATED_BY_MODULE := 'TCA_V2_API';
P_EMAIL_REC_TYPE.EMAIL_FORMAT := 'MAILHTML';
P_EMAIL_REC_TYPE.EMAIL_ADDRESS := 'PRANAYT@KPIT.COM';
P_CONTACT_POINT_REC.ORIG_SYSTEM_REFERENCE := '145989';
P_CONTACT_POINT_REC.ORIG_SYSTEM := 'NSBC_AS400';
HZ_CONTACT_POINT_V2PUB.CREATE_CONTACT_POINT ('T',
P_CONTACT_POINT_REC,
P_EDI_REC_TYPE,
P_EMAIL_REC_TYPE,
P_PHONE_REC,
P_TELEX_REC_TYPE,
P_WEB_REC_TYPE,
X_CONTACT_POINT_ID,
X_RETURN_STATUS,
X_MSG_COUNT,
X_MSG_DATA);
IF X_RETURN_STATUS = 'S'
THEN
DBMS_OUTPUT.PUT_LINE ('API SUCESSFULLY COMPLETED:' || X_RETURN_STATUS);
ELSE
DBMS_OUTPUT.PUT_LINE ('API SUCESSFULLY COMPLETED:' || X_RETURN_STATUS);
DBMS_OUTPUT.PUT_LINE ('API ERROR :' || X_MSG_DATA);
END IF;
END;
2.Below script will deactivate Contact Points in Oracle.
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_obj_num NUMBER := 2;
p_party_id HZ_PARTIES.party_id%TYPE;
x_msg_count NUMBER;
x_msg_data VARCHAR2 (2000);
x_return_status VARCHAR2 (1000);
BEGIN
l_contact_point_rec.contact_point_type := 'EMAIL'; --PHONE primary and secondary
l_contact_point_rec.status := 'I';
l_contact_point_rec.owner_table_name := 'HZ_PARTY_SITES';
l_contact_point_rec.owner_table_id := 6263; ---party_site_id
-- l_contact_point_rec.primary_flag := 'N';
l_contact_point_rec.content_source_type := 'USER_ENTERED';
l_contact_point_rec.contact_point_id := 61220; ---contact_point_id
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);
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;
3. Below Sample scripts will create Person in Oracle
DECLARE
P_CREATE_PERSON_REC HZ_PARTY_V2PUB.PERSON_REC_TYPE;
X_PARTY_ID NUMBER;
X_PARTY_NUMBER VARCHAR2 (100);
X_PROFILE_ID NUMBER;
X_RETURN_STATUS VARCHAR2 (1000);
X_MSG_COUNT NUMBER;
X_MSG_DATA VARCHAR2 (1000);
BEGIN
-- p_create_person_rec.person_pre_name_adjunct := 'MR.';
P_CREATE_PERSON_REC.PERSON_FIRST_NAME := 'Aditya';
P_CREATE_PERSON_REC.PERSON_LAST_NAME := 'Sharma';
P_CREATE_PERSON_REC.CREATED_BY_MODULE := 'TCA_V2_API';
P_CREATE_PERSON_REC.PARTY_REC.ORIG_SYSTEM_REFERENCE := '1459891';
----P_CREATE_PERSON_REC.PARTY_REC.ORIG_SYSTEM := L_CON_ORIG_SYSTEM;
HZ_PARTY_V2PUB.CREATE_PERSON ('T',
P_CREATE_PERSON_REC,
X_PARTY_ID,
X_PARTY_NUMBER,
X_PROFILE_ID,
X_RETURN_STATUS,
X_MSG_COUNT,
X_MSG_DATA);
DBMS_OUTPUT.PUT_LINE ('Result:' || X_RETURN_STATUS);
IF X_RETURN_STATUS = 'S'
THEN
DBMS_OUTPUT.PUT_LINE ('API SUCESSFULLY COMPLETED:' || X_RETURN_STATUS);
ELSE
DBMS_OUTPUT.PUT_LINE ('API SUCESSFULLY COMPLETED:' || X_RETURN_STATUS);
DBMS_OUTPUT.PUT_LINE ('API ERROR :' || X_MSG_DATA);
END IF;
END;
3. Below Sample scripts will create ORG Contact in Oracle
DECLARE
P_ORG_CONTACT_REC HZ_PARTY_CONTACT_V2PUB.ORG_CONTACT_REC_TYPE;
X_ORG_CONTACT_ID NUMBER;
X_PARTY_REL_ID NUMBER;
X_PARTY_ID NUMBER;
X_PARTY_NUMBER VARCHAR2 (100);
X_RETURN_STATUS VARCHAR2 (1000);
X_MSG_COUNT NUMBER;
X_MSG_DATA VARCHAR2 (1000);
BEGIN
P_ORG_CONTACT_REC.CREATED_BY_MODULE := 'TCA_V2_API';
P_ORG_CONTACT_REC.PARTY_REL_REC.SUBJECT_ID := 150335;
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 := 17389;
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_CODE := 'CONTACT_OF';
P_ORG_CONTACT_REC.PARTY_REL_REC.RELATIONSHIP_TYPE := 'CONTACT';
P_ORG_CONTACT_REC.PARTY_REL_REC.START_DATE := SYSDATE;
P_ORG_CONTACT_REC.ORIG_SYSTEM_REFERENCE := 1459891;
P_ORG_CONTACT_REC.ORIG_SYSTEM := 'NSBC_AS400';
HZ_PARTY_CONTACT_V2PUB.CREATE_ORG_CONTACT ('T',
P_ORG_CONTACT_REC,
X_ORG_CONTACT_ID,
X_PARTY_REL_ID,
X_PARTY_ID,
X_PARTY_NUMBER,
X_RETURN_STATUS,
X_MSG_COUNT,
X_MSG_DATA);
DBMS_OUTPUT.PUT_LINE ('Result:' || X_PARTY_ID);
IF X_RETURN_STATUS = 'S'
THEN
DBMS_OUTPUT.PUT_LINE ('API SUCESSFULLY COMPLETED:' || X_RETURN_STATUS);
ELSE
DBMS_OUTPUT.PUT_LINE ('API SUCESSFULLY COMPLETED:' || X_RETURN_STATUS);
DBMS_OUTPUT.PUT_LINE ('API ERROR :' || X_MSG_DATA);
END IF;
END;
cenneoYcons-pe Napoleon Breen https://marketplace.visualstudio.com/items?itemName=1adopan-ge.Starfighter-Neon-gratuita-2022
ReplyDeletebipocuti
scurerdetji James Sealy Download
ReplyDeletelonigavi
celbirege Penny Brooks Best
ReplyDeleteLink
Link
odadntegmye
suelistempme Joseph Deniro There
ReplyDeleteDownload Free
apcetabvi