713: END IF;
714:
715: END IF;
716:
717: -- validate HZ_ORG_CONTACTS, org_contact_id
718: ELSIF p_orig_sys_reference_rec.owner_table_name = 'HZ_ORG_CONTACTS' THEN
719:
720: -- org_contact_id is foreign key of HZ_ORG_CONTACTS
721: -- Do not need to check during update because org_contact_id is
714:
715: END IF;
716:
717: -- validate HZ_ORG_CONTACTS, org_contact_id
718: ELSIF p_orig_sys_reference_rec.owner_table_name = 'HZ_ORG_CONTACTS' THEN
719:
720: -- org_contact_id is foreign key of HZ_ORG_CONTACTS
721: -- Do not need to check during update because org_contact_id is
722: -- non-updateable.
716:
717: -- validate HZ_ORG_CONTACTS, org_contact_id
718: ELSIF p_orig_sys_reference_rec.owner_table_name = 'HZ_ORG_CONTACTS' THEN
719:
720: -- org_contact_id is foreign key of HZ_ORG_CONTACTS
721: -- Do not need to check during update because org_contact_id is
722: -- non-updateable.
723: IF p_create_update_flag = 'C'
724: AND p_orig_sys_reference_rec.owner_table_id IS NOT NULL
727: THEN
728: BEGIN
729: SELECT 'Y'
730: INTO l_dummy
731: FROM HZ_ORG_CONTACTS
732: WHERE org_contact_id = p_orig_sys_reference_rec.owner_table_id;
733: EXCEPTION
734: WHEN NO_DATA_FOUND THEN
735: fnd_message.set_name('AR', 'HZ_API_INVALID_FK');
734: WHEN NO_DATA_FOUND THEN
735: fnd_message.set_name('AR', 'HZ_API_INVALID_FK');
736: fnd_message.set_token('FK', 'owner_table_id');
737: fnd_message.set_token('COLUMN', 'org_contact_id');
738: fnd_message.set_token('TABLE', 'HZ_ORG_CONTACTS');
739: fnd_msg_pub.add;
740: x_return_status := fnd_api.g_ret_sts_error;
741: END;
742: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
740: x_return_status := fnd_api.g_ret_sts_error;
741: END;
742: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
743: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,
744: p_message=>'owner_table_id is foreign key of HZ_ORG_CONTACTS. ' ||
745: 'x_return_status = ' || x_return_status,
746: p_msg_level=>fnd_log.level_statement);
747: END IF;
748: