This chapter covers the following topics:
PL/SQL Package Name: HZ_CONTACT_PREFERENCE_V2PUB
Java Class Name: HzContactPreferenceV2Pub
TYPE contact_preference_rec_type IS RECORD ( contact_preference_id NUMBER, contact_level_table VARCHAR2(30), contact_level_table_id NUMBER, contact_type VARCHAR2(30), preference_code VARCHAR2(30), preference_topic_type VARCHAR2(30), preference_topic_type_id NUMBER, preference_topic_type_code VARCHAR2(30), preference_start_date DATE, preference_end_date DATE, preference_start_time_hr NUMBER, preference_end_time_hr NUMBER, preference_start_time_mi NUMBER, preference_end_time_mi NUMBER, max_no_of_interactions NUMBER, max_no_of_interact_uom_code VARCHAR2(30), requested_by VARCHAR2(30), reason_code VARCHAR2(30), status VARCHAR2(1), created_by_module VARCHAR2(150), application_id NUMBER )
public static class ContactPreferenceRec { public BigDecimal contact_preference_id; public String contact_level_table; public BigDecimal contact_level_table_id; public String contact_type; public String preference_code; public String preference_topic_type; public BigDecimal preference_topic_type_id; public String preference_topic_type_code; public java.sql.Timestamp preference_start_date; public java.sql.Timestamp preference_end_date; public BigDecimal preference_start_time_hr; public BigDecimal preference_end_time_hr; public BigDecimal preference_start_time_mi; public BigDecimal preference_end_time_mi; public BigDecimal max_no_of_interactions; public String max_no_of_interact_uom_code; public String requested_by; public String reason_code; public String status; public String created_by_module; public BigDecimal application_id; public ContactPreferenceRec(); public ContactPreferenceRec(boolean __RosettaUseGMISSValues); }
This routine creates a Contact Preference. The API creates a record in the HZ_CONTACT_PREFERENCES table. Contact preference can be created for the Party, Party Site or Contact Point.
PROCEDURE create_contact_preference ( p_init_msg_list IN VARCHAR2:= FND_API.G_FALSE, p_contact_preference_rec IN CONTACT_PREFERENCE_REC_TYPE, x_contact_preference_id OUT NUMBER, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2 )
public static void createContactPreference( OracleConnection_connection, String p_init_msg_list, ContactPreferenceRec p_contact_preference_rec, BigDecimal [ ] x_contact_preference_id, String [ ] x_return_status, BigDecimal [ ] x_msg_count, String [ ] x_msg_data ) throws SQLException;
The following table lists information about the parameters in the Create Contact Preference API. The table includes the parameter names, the type of each parameter, the data type of each parameter, the necessity of the parameter, and other information about the parameter such as validation, defaults, and other comments.
Parameter Name | Type | Data Type | Required | Validation, Default, Comment |
---|---|---|---|---|
contact_preference_id | IN | NUMBER | No | Validation: Unique if passed in, else generated from sequence |
contact_level_table | IN | VARCHAR2 | Yes | Validation:
|
contact_level_table_id | IN | NUMBER | Yes | Validation:
|
contact_type | IN | VARCHAR2 | Yes | Validation:
|
preference_code | IN | VARCHAR2 | Yes | Validation:
|
preference_topic_type | IN | VARCHAR2 | N | Validation:
TABLES:
|
preference_topic_type_id | IN | NUMBER | N | Validation : Valid if the value in the PREFERENCE_TOPIC_TYPE attribute is one of these values:
The PREFERENCE_TOPIC_TYPE attribute is the foreign key of table selected PREFERENCE_TOPIC_TYPE. |
preference_topic_type_code | IN | VARCHAR2 | N | Validation: If PREFERENCE_TOPIC_TYPE = CONTACT_USAGE, then PREFERENCE_TOPIC_TYPE_CODE should be a lookup code of lookup type CONTACT_USAGE. Validation exists to ensure that this lookup code exists. If PREFERENCE_TOPIC_TYPE is FND_BUSINESS_PURPOSES_B, then PREFERENCE_TOPIC_TYPE_CODE is the name of a column in FND_BUSINESS_PURPOSES_B. No validation exists to ensure that the value passed is a proper column name. |
preference_start_date | IN | DATE | Y | Validation: Mandatory attribute. |
preference_end_date | IN | DATE | N | Validation:
|
preference_start_time_hr | IN | NUMBER | N | Validation: In 0 to 24 hour format. PREFERENCE_END_TIME_HR: PREFERENCE_END_TIME_MI should be greater than or equal to PREFERENCE_START_TIME_MI: PREFERENCE_START_TIME_MI |
preference_end_time_hr | IN | NUMBER | N | Validation: In 0 to 24 hour format. PREFERENCE_END_TIME_HR: PREFERENCE_END_TIME_MI should be greater than or equal to PREFERENCE_START_TIME_MI: PREFERENCE_START_TIME_MI |
preference_start_time_mi | IN | NUMBER | N | Validation: In 0 to 59 minute format PREFERENCE_END_TIME_HR: PREFERENCE_END_TIME_MI should be greater than or equal to PREFERENCE_START_TIME_MI: PREFERENCE_START_TIME_MI |
preference_end_time_mi | IN | NUMBER | N | Validation: In 0 to 59 minute format PREFERENCE_END_TIME_HR: PREFERENCE_END_TIME_MI should be greater than or equal to PREFERENCE_START_TIME_MI: PREFERENCE_START_TIME_MI |
max_no_of_interactions | IN | NUMBER | N | Validation: none |
max_no_of_interact_uom_code | IN | VARCHAR2 | N | Validation: The MAX_NO_OF_INTERACT_UOM_CODE column should be validated against the new MAX_NO_OF_INTERACT_UOM_CODE lookup. |
requested_by | IN | VARCHAR2 | Y | Validation:
|
reason_code | IN | VARCHAR2 | N | Validation : Validated against the REASON_CODE lookup type. |
status | IN | VARCHAR2 | N | Validation : Should be validated against the CODE_STATUS lookup type. The PREFERENCE_END_DATE attribute should be set to the sysdate when STATUS has a value other than A. |
created_by_module | IN | VARCHAR2 | Y | Validation: Mandatory attribute. Validated against AR lookup type HZ_CREATED_BY_MODULE. |
application_id | IN | NUMBER | N | Comment: Text to indicate application from which creation of record is initiated. |
x_contact_preference_id | OUT | NUMBER | N | Comment: Returns contact_preference_id of the record created. |
When a contact point is created, PREFERENCE_START_DATE is defaulted to the system date if a value is not passed and the PREFERENCE_CODE should be set to “Do” in HZ_CONTACT_PREFERENCES unless the party explicitly opts-out (in that case the PREFERENCE_CODE should be set to “Do Not” and the PREFERENCE_START_DATE should be set to the system date if no date has been specified by the party
If a value is passed for MAX_NO_OF_INTERACT_UOM_CODE then the PREFERENCE_START_DATE should have a value. If a value is not passed for PREFERENCE_START_DATE it should default to the system date.
Duplication check. uniquely identify a contact preference to prevent duplication record to be created in HZ_CONTACT_PREFERENCES by checking the follow columns:
contact_level_table
contact_level_table_id
contact_type
preference_topic_type
preference_topic_type_id
preference_topic_type_code
When the CONTACT_LEVEL_TABLE attribute is HZ_CONTACT_POINTS, the CONTACT_TYPE cannot be MAIL or VISIT.
CONTACT_TYPE lookup should be validated against the HZ_CONTACT_POINTS.CONTACT_POINT_TYPE column based on the value passed in HZ_CONTACT_PREFERENCES.CONTACT_LEVEL_TABLE. So if the value passed in HZ_CONTACT_PREFERENCES.CONTACT_LEVEL_TABLE is HZ_CONTACT_POINTS and the HZ_CONTACT_LEVEL_TABLE_ID signifies that the contact point is an email address, then the values that will be allowed in HZ_CONTACT_PREFERENCES.CONTACT_TYPE will be 'EMAIL' only.
The following table gives the values that can be passed in HZ_CONTACT_PREFERENCES.CONTACT_TYPE based on the HZ_CONTACT_POINT.CONTACT_POINT_TYPE, HZ_CONTACT_PREFERENCES.CONTACT_LEVEL_TABLE and HZ_CONTACT_PREFERENCES/CONTACT_LEVEL_TABLE_ID
CONTACT_TYPE allowed | when CONTACT_POINT_TYPE is | and CONTACT_LEVEL_TABLE is |
---|---|---|
CALL | PHONE | HZ_CONTACT_POINTS |
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES | |
SMS | SMS | HZ_CONTACT_POINTS |
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES | |
VISIT | NONE | HZ_PARTY_SITES |
NONE | HZ_PARTIES | |
HZ_CONTACT_POINTS | ||
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES | |
FAX | FAX | HZ_CONTACT_POINTS |
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES | |
TELEX | TLX | HZ_CONTACT_POINTS |
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES | |
EDI | EDI | HZ_CONTACT_POINTS |
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES |
This routine updates a Contact Preference. The API updates a record in the HZ_CONTACT_PREFERENCES table for Party, Party Site or Contact Point.
PROCEDURE update_contact_preference ( p_init_msg_list IN VARCHAR2:= FND_API.G_FALSE, p_contact_preference_rec IN CONTACT_PREFERENCE_REC_TYPE, p_object_version_number IN OUT NUMBER, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2 )
public static void updateContactPreference( OracleConnection_connection, String p_init_msg_list, ContactPreferenceRec p_contact_preference_rec, BigDecimal [ ] p_object_version_number, String [ ] x_return_status, BigDecimal [ ] x_msg_count, String [ ] x_msg_data ) throws SQLException;
The following table lists information about the parameters in the Update Contact Preference API. The table includes the parameter names, the type of each parameter, the data type of each parameter, the necessity of the parameter, and other information about the parameter such as validation, defaults, and other comments.
Parameter Name | Type | Data Type | Required | Validation, Default, Comment |
---|---|---|---|---|
contact_preference_id | IN | NUMBER | Yes | Validation: Valid contact_preference_id should be passed in Comment: Pass contact_preference_id from hz_contact_preferences table |
contact_level_table | IN | VARCHAR2 | No | Validation: Non updateable |
contact_level_table_id | IN | NUMBER | No | Validation: Non updateable |
contact_type | IN | VARCHAR2 | No | Validation: Non updateable |
preference_code | IN | VARCHAR2 | No | Validation: Should be validated against the PREFERENCE_CODE AR lookup type |
preference_topic_type | IN | VARCHAR2 | No | Validation: Should be validated against the PREFERENCE_TOPIC_TYPE lookup type. The lookup contains the following lookup_codes against which the PREFERENCE_TOPIC_TYPE will be validated TABLES
|
preference_topic_type_id | IN | NUMBER | No | Validation: If the value in the PREFERENCE_TOPIC_TYPE attribute is one of these values:
The PREFERENCE_TOPIC_TYPE attribute is the foreign key of table selected in the attribute PREFERENCE_TOPIC_TYPE. |
preference_topic_type_code | IN | VARCHAR2 | No | Validation: If PREFERENCE_TOPIC_TYPE = CONTACT_USAGE, then PREFERENCE_TOPIC_TYPE_CODE should be a lookup code of lookup type CONTACT_USAGE. Validation exists to ensure that this lookup code exists. If PREFERENCE_TOPIC_TYPE is FND_BUSINESS_PURPOSES_B, then PREFERENCE_TOPIC_TYPE_CODE is the name of a column in FND_BUSINESS_PURPOSES_B. No validation exists to ensure that the value passed is a proper column name. |
preference_start_date | IN | DATE | No | Validation: The value of the PREFERENCE_END_DATE attribute should be greater than or equal to the value of the PREFERENCE_START_DATE attribute. |
preference_end_date | IN | DATE | No | Validation:
|
preference_start_time_hr | IN | NUMBER | No | Validation: In 0 to 24 hour format PREFERENCE_END_TIME_HR: PREFERENCE_END_TIME_MI should be greater than or equal to PREFERENCE_START_TIME_MI: PREFERENCE_START_TIME_MI |
preference_end_time_hr | IN | NUMBER | No | Validation: In 0 to 24 hour format PREFERENCE_END_TIME_HR: PREFERENCE_END_TIME_MI should be greater than or equal to PREFERENCE_START_TIME_MI: PREFERENCE_START_TIME_MI |
preference_start_time_mi | IN | NUMBER | No | Validation: In 0 to 59 minute format PREFERENCE_END_TIME_HR: PREFERENCE_END_TIME_MI should be greater than or equal to PREFERENCE_START_TIME_MI: PREFERENCE_START_TIME_MI |
preference_end_time_mi | IN | NUMBER | No | Validation: In 0 to 59 minute format PREFERENCE_END_TIME_HR: PREFERENCE_END_TIME_MI should be greater than or equal to PREFERENCE_START_TIME_MI: PREFERENCE_START_TIME_MI |
max_no_of_interactions | IN | NUMBER | No | Validation: none |
max_no_of_interact_uom_code | IN | VARCHAR2 | No | Validation: The MAX_NO_OF_INTERACT_UOM_CODE column should be validated against the new MAX_NO_OF_INTERACT_UOM_CODE lookup. |
requested_by | IN | VARCHAR2 | No | Validation: REQUESTED_BY should be validated against the REQUESTED_BY AR lookup type |
reason_code | IN | VARCHAR2 | No | Validation: Should be validated against the REASON_CODE lookup type |
status | IN | VARCHAR2 | No | Validation:
|
created_by_module | IN | VARCHAR2 | No | Validation: Non updateable if value exists, else validated against AR lookup type HZ_CREATED_BY_MODULE. |
application_id | IN | NUMBER | No | Validation: Not updateable if value exists |
p_object_version_number | IN OUT |
NUMBER | Yes | Validation:
Comment:
|
When a contact point is created, PREFERENCE_START_DATE is defaulted to the system date if a value is not passed and the PREFERENCE_CODE should be set to “Do” in HZ_CONTACT_PREFERENCES unless the party explicitly opts-out (in that case the PREFERENCE_CODE should be set to “Do Not” and the PREFERENCE_START_DATE should be set to the system date if no date has been specified by the party
If the STATUS column in HZ_CONTACT_POINTS is set to a value other than “A” for “Active such as “I” for Inactive, “M” for Merged, or “D” for Deleted, then PREFERENCE_END_DATE should be set. If a value for PREFERENCE_END_DATE is not passed in these situations, it should default to the system date. If a value other than the system date is passed, it should fail.
If a value is passed for MAX_NO_OF_INTERACT_UOM_CODE then the PREFERENCE_START_DATE should have a value. If a value is not passed for PREFERENCE_START_DATE it should default to the system date.
Duplication check. uniquely identify a contact preference to prevent duplication record to be created in HZ_CONTACT_PREFERENCES by checking the follow columns:
contact_level_table
contact_level_table_id
contact_type
preference_topic_type
preference_topic_type_id
preference_topic_type_code
When the CONTACT_LEVEL_TABLE attribute is HZ_CONTACT_POINTS, the CONTACT_TYPE cannot be MAIL or VISIT.
CONTACT_TYPE lookup should be validated against the HZ_CONTACT_POINTS.CONTACT_POINT_TYPE column based on the value passed in HZ_CONTACT_PREFERENCES.CONTACT_LEVEL_TABLE. So if the value passed in HZ_CONTACT_PREFERENCES.CONTACT_LEVEL_TABLE is HZ_CONTACT_POINTS and the HZ_CONTACT_LEVEL_TABLE_ID signifies that the contact point is an email address, then the values that will be allowed in HZ_CONTACT_PREFERENCES.CONTACT_TYPE will be 'EMAIL' only.
The following table gives the values that can be passed in HZ_CONTACT_PREFERENCES.CONTACT_TYPE based on the HZ_CONTACT_POINT.CONTACT_POINT_TYPE, HZ_CONTACT_PREFERENCES.CONTACT_LEVEL_TABLE and HZ_CONTACT_PREFERENCES/CONTACT_LEVEL_TABLE_ID
CONTACT_TYPE allowed | when CONTACT_POINT_TYPE is | and CONTACT_LEVEL_TABLE is |
---|---|---|
CALL | PHONE | HZ_CONTACT_POINTS |
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES | |
SMS | SMS | HZ_CONTACT_POINTS |
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES | |
VISIT | NONE | HZ_PARTY_SITES |
NONE | HZ_PARTIES | |
HZ_CONTACT_POINTS | ||
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES | |
FAX | FAX | HZ_CONTACT_POINTS |
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES | |
TELEX | TLX | HZ_CONTACT_POINTS |
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES | |
EDI | EDI | HZ_CONTACT_POINTS |
NONE | HZ_PARTY_SITES | |
NONE | HZ_PARTIES |