613: (p_rec in out nocopy per_all_people_f%rowtype) is
614: --
615: l_proc varchar2(80) := g_package||'create_update_contact_point';
616: --
617: -- Cursor to select existing email address from hz_parties
618: CURSOR c1 IS
619: SELECT email_address, last_update_date,contact_point_id,status
620: FROM hz_contact_points hcp
621: WHERE hcp.contact_point_type = 'EMAIL'
618: CURSOR c1 IS
619: SELECT email_address, last_update_date,contact_point_id,status
620: FROM hz_contact_points hcp
621: WHERE hcp.contact_point_type = 'EMAIL'
622: and hcp.owner_table_name = 'HZ_PARTIES'
623: and hcp.owner_table_id = p_rec.party_id
624: order by last_update_date desc,contact_point_id desc;
625:
626:
739: --
740: hr_utility.set_location(l_proc,50);
741: --
742: l_contact_point_rec.contact_point_type := 'EMAIL';
743: l_contact_point_rec.owner_table_name := 'HZ_PARTIES';
744: l_contact_point_rec.owner_table_id := p_rec.party_id;
745: l_contact_point_rec.status := 'A';
746: l_contact_point_rec.primary_flag := 'Y';
747: l_email_rec.email_address := p_rec.email_address;
910: --
911: hr_utility.set_location(l_proc,120);
912: --
913: l_contact_point_rec.contact_point_type := 'EMAIL';
914: l_contact_point_rec.owner_table_name := 'HZ_PARTIES';
915: l_contact_point_rec.owner_table_id := p_rec.party_id;
916: l_contact_point_rec.status := 'A';
917: l_contact_point_rec.primary_flag := 'Y';
918: l_email_rec.email_address := p_rec.email_address;
2493: -- Bug fix 4227635 starts here--
2494: -- Updated orig_system_reference to party id when the
2495: -- link is broken between the TCA and HR.
2496:
2497: update hz_parties
2498: set orig_system_reference = p_rec.party_id
2499: where party_id = p_rec.party_id
2500: and substr(orig_system_reference,1,4) = 'PER:';
2501:
3127: -- Get the latest person record
3128: --
3129: select max(last_update_date)
3130: into l_party_last_update_date
3131: from hz_parties
3132: where party_id = p_rec.party_id;
3133: --
3134: --Added for bug 2648797
3135: --Get the object version number
3135: --Get the object version number
3136:
3137: select max(object_version_number)
3138: into l_party_object_version_number
3139: from hz_parties
3140: where party_id = p_rec.party_id;
3141: --
3142: -- Call TCA API and update the person.
3143: --
3190: -- and then assigned that party to an HR person.
3191: -- This will prevent any future updates to the TCA data unless the update
3192: -- comes from HR.
3193: --
3194: update hz_parties
3195: set orig_system_reference = 'PER:'||p_rec.person_id
3196: where party_id = p_rec.party_id
3197: and substr(orig_system_reference,1,4) <> 'PER:';
3198: --
5900: and ppf.effective_end_date = hr_api.g_eot
5901: and ppf.party_id is not null
5902: and not exists(select null
5903: from hz_contact_points
5904: where owner_table_name = 'HZ_PARTIES'
5905: and owner_table_id = ppf.party_id
5906: and email_address = nvl(ppf.email_address,'NULL'));
5907: --
5908: l_person c_person%rowtype;
6275: and ppf.effective_end_date = hr_api.g_eot
6276: and ppf.party_id is not null
6277: and not exists(select /*+ no_unnest */ null
6278: from hz_contact_points
6279: where owner_table_name = 'HZ_PARTIES'
6280: and owner_table_id = ppf.party_id
6281: and email_address = nvl(ppf.email_address,'NULL'));
6282:
6283: --